Does Heroku support `rails dbconsole`?

后端 未结 4 452
傲寒
傲寒 2021-02-02 10:26

I\'m trying to fire up rails dbconsole on Heroku but get the following error:

heroku run rails dbconsole
# => Couldn\'t find database client: psq         


        
4条回答
  •  余生分开走
    2021-02-02 10:57

    Is it possible to use the dbconsole on Heroku? If not is there another client that can be used?

    You can use online database client if you use activeadmin.

    Just add the gem activeadmin-sqlpage:

    gem 'activeadmin-sqlpage'
    

    And create activeadmin page:

    # file app/admin/sql.rb
    ActiveAdmin::SqlPage::register
    

    Restart your server. Then go to admin panel and navigate the menu SQL. Enter any sql command and press Ctrl+Enter or Submit button.

提交回复
热议问题