From d747b531728230bab73bd38b695f8bde1d95f704 Mon Sep 17 00:00:00 2001 From: Abhay Nikam Date: Tue, 11 Aug 2020 21:37:37 +0530 Subject: [PATCH] Document the --database/--db option for multiple database Rails application [skip ci] --- guides/source/command_line.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/guides/source/command_line.md b/guides/source/command_line.md index d079375764..595de9035a 100644 --- a/guides/source/command_line.md +++ b/guides/source/command_line.md @@ -395,6 +395,12 @@ With the `helper` method it is possible to access Rails and your application's h INFO: You can also use the alias "db" to invoke the dbconsole: `bin/rails db`. +If you are using multiple databases, `bin/rails dbconsole` will connect to the primary database by default. You can specify which database to connect to using `--database` or `--db`: + +```bash +$ bin/rails dbconsole --database=animals +``` + ### `bin/rails runner` `runner` runs Ruby code in the context of Rails non-interactively. For instance: