New in Rails 8: Bring Your Favorite CLI to rails dbconsole
Rails 8 got even better for developers who love clean CLI workflows.
You can now customize the command-line tool used by rails dbconsole
with the new config.active_record.database_cli
setting.
Prefer pgcli over the default psql
to connect to your database? Make your dev experience smoother with autocomplete and syntax highlighting:
# config/initializers/database_cli.rb
Rails.application.configure do
if Rails.env.local?
config.active_record.database_cli = {postgresql: "pgcli"}
end
end
Available since Rails 8.0.0.beta1 — check out the pull request for full details and start customizing your database workflow today.
Written on May 21, 2025