0.0
No commit activity in last 3 years
No release in over 3 years
A Rake task to painlessly open a database shell. Launches the command line client of the current Rails environment's database and automatically connects to the right database.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.7
~> 10.0
 Project Readme

dbshell-rails

A Rake task to launch a database shell, using the connection parameters specified in your Rails application. The shell will be automatically connected to the current environment's database.

The following databases are supported:

  • PostgreSQL (runs psql)
  • MySQL (runs mysql)
  • SQLite (runs sqlite3)

After being a Djangonaut for a while and then doing more work in Rails, I was surprised that it apparently has no equivalent to Django's ./manage.py dbshell command. This launcher program aims to provide that missing functionality.

Usage

$ rake dbshell
example_app_development=#

$ rails dbshell
example_app_development=#

$ RAILS_ENV=test rake dbshell
example_app_test=#

Installation

Add this line to your application's Gemfile:

gem 'dbshell-rails'

And then execute:

$ bundle

License

Copyright © 2017 Teddy Wing. Licensed under the GNU LGPLv3+ (see the included COPYING & COPYING.LESSER files).