Project

rackdb

0.0
No commit activity in last 3 years
No release in over 3 years
Database console for Ruby applications running on Rack with ActiveRecord and following the Rails "config/database.yml" database configuration pattern
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

rackdb

Gem Version Build Status License

About

rackdb is a database console for Ruby applications that run on Rack, which follow the Rails-like convention of a config/database.yml file describing the database connection parameters. This includes Rails applications and Hoodoo services.

If environment variable DATABASE_URL is defined, it will be assumed to contain a fully qualified URI for connecting to the database of choice and will take precedence over config.yml. This is often the case for Hoodoo services in cloud-based deployment configurations with remote database services like RDS, rather than under development or in production with a locally hosted database.

  • The URI is parsed and config.yml-style parameters are filled in using its components.
  • PostgreSQL, MySQL and SQL Server URIs are very similar and should all work in theory, conveying the host, port, username, password and database name options where present in the URI. Only PostgreSQL is actually tested against a real database at the time of writing - the others were coded by observation.
  • SQLite URIs of sqlite:// are assumed to be for a SQLite v3 database and the pathname of the URI is taken as the path to the database file on the local filesystem.
  • Oracle URIs are extremely unusual and are not supported.
  • A jdbc: scheme prefix is ignored if present; for example, jdbc:mysql://... and mysql:// would both be treated the same way.

The code is based upon racksh, the Ruby on Rails dbconsole code and the Hoodoo service shell. For more information, see the Rails documentation for dbconsole.

Installation

gem install rackdb

Usage

To open a default shell:

cd some_application_or_service
bundle exec rackdb

For help:

bundle exec rackdb --help

Quick access to specific environment database consoles:

bundle exec rackdb <environment_name>

Bugs & feature requests

Please use the GitHub issue tracker.

Authors