Rails2.1新特性之script/dbconsole
原文连接:http://blog.codefront.net/2008/05/11/living-on-the-edge-of-rails-20-scriptdbconsole-and-flashnow-now-test-able/
script/dbconsole 脚本允许用户使用Rails的控制台客户端连接到数据库。
如果需要连接到MySQL的生产数据库作一些操作,直接运行 RAILS_ENV=production script/dbconsole 就能登录到数据库服务器上并使用MySQL的命令行客户端。当然,这个脚本也同样在 PostgreSQL 和 SQLite 数据库运行。
要在当前Rails应用程序中使用这个新脚本,就要先升级到edge Rails,再运行 rake rails:update:script 。好好享受这个脚本的便利吧。
This entry was posted on 星期一, 05月 12th, 2008 at 11:23 pm and is filed under Ruby. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Have your say
You must be logged in to post a comment.