opening database prompt based on database.yml

Hello everybody,

I wrote a script to open a database prompt based on the contents of database.yml

See the rdb_prompt directory under

  GitHub - stephanwehner/railsgoodies: Various goodies related to Ruby on Rails

I find it very useful, since I work with several different branches of Rails projects, each possibly having different migrations which are applied to different (mysql) databases.

Opening a (mysql) prompt would require looking up the name of the database, and more -- which a script can do faster than me.

(sqlite3 / postgresql also supported)

The current README is below. To obtain a copy, use this "Public Clone URL":

  git://github.com/stephanwehner/railsgoodies.git

or use github's download function.

Cheers,

Stephan

=========================== Contents of file README

Don't want to piss on anyone's parade but Rails comes with a script that does that eg

ruby script/dbconsole production

Fred

Stephan Wehner wrote:

Frederick Cheung wrote:

Rails projects, each possibly having different migrations which are applied to different (mysql) databases.

Opening a (mysql) prompt would require looking up the name of the database, and more -- which a script can do faster than me.

Don't want to piss on anyone's parade but Rails comes with a script that does that eg

ruby script/dbconsole production

It looks to me that script/dbconsole doesn't hide the password for mysql and postgresql on all platforms -- whereas rdb_prompt takes care of that (for postgresql trivially by not supporting passwords).

So I'll put a patch together.

The patch is attached to this new ticket

#2707 dbconsole support password passing through /dev/fd/ - Ruby on Rails - rails

Please review.

Stephan