As seen in the Commit History: script/dbconsole May 8th, 2008

While going to the recent Rails Git logs, I stumbled across a cool new feature: dbconsole.

We all know and love the Rails console, which gives us an easy interface to our Rails environment, but sometimes we have to be in the database itself.. When this happened, most of the time we had to look up how our database was called, what kind of database it was, basically look at our database.yml file, but no more!

jan:railsproject jan$ script/dbconsole 
SQLite version 3.5.6
Enter ".help" for instructions
sqlite> select * from products;
...

and with easy access to each environment:

jan:railsproject jan$ script/dbconsole production
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.0.41 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

How cool is that!

tags: l 3 comments »