LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

rails-db

Open database console for Rails application

TLDR

Open a database console for the current environment
$ rails db
copy
Open a database console for production
$ rails db -e production
copy
Open a database console with a specific database configuration
$ rails db --database=[database_name]
copy

SYNOPSIS

rails db [-e environment] [--database name] [-h]

DESCRIPTION

rails db (also known as rails dbconsole) opens an interactive session with the database configured for your Rails application. It automatically detects the database adapter and launches the appropriate client (psql for PostgreSQL, mysql for MySQL, sqlite3 for SQLite, etc.).The command reads database configuration from config/database.yml and connects using the credentials and connection details specified there. This provides quick access to the database without manually remembering connection strings.

PARAMETERS

-e, --environment ENV

Specify the Rails environment (development, test, production)
--database name
Connect to a specific database when multiple databases are configured
-h, --help
Show help information

CAVEATS

Requires the corresponding database client to be installed on the system (psql, mysql, sqlite3, etc.). The command will fail if the client is not in the PATH.Database credentials are read from the configuration file. Ensure sensitive credentials are properly secured, especially in production environments.

SEE ALSO

rails(1), rails-console(1), psql(1), mysql(1), sqlite3(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid