diff options
author | Teddy Wing | 2017-04-29 19:36:30 +0200 |
---|---|---|
committer | Teddy Wing | 2017-04-29 19:36:30 +0200 |
commit | 9f741398657ca47483211ffa6cb0a9dfbe3f88c8 (patch) | |
tree | 1600526f226c0e9846205b21ff2a09065f6f624f /lib/dbshell/rails/tasks | |
parent | 295407026c52216869a98dbed877a09edb801bc6 (diff) | |
download | dbshell-rails-9f741398657ca47483211ffa6cb0a9dfbe3f88c8.tar.bz2 |
Get `rake dbshell` working for SQLite3
Add `DBShell::Sqlite3.runshell`, which takes database connection
information and starts a SQLite3 shell.
Currently the Rake task just calls the SQLite3 `.runshell` method
directly without any database adapter discrimination and also forces the
development environment. It's nice to see it working. Now, we'll need to
clean up those parts of the Rakefile.
Diffstat (limited to 'lib/dbshell/rails/tasks')
-rw-r--r-- | lib/dbshell/rails/tasks/dbshell.rake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/dbshell/rails/tasks/dbshell.rake b/lib/dbshell/rails/tasks/dbshell.rake index 6a74c53..5d19338 100644 --- a/lib/dbshell/rails/tasks/dbshell.rake +++ b/lib/dbshell/rails/tasks/dbshell.rake @@ -1,6 +1,8 @@ +require 'dbshell/sqlite3_client' + task :dbshell do # {"default"=>{"adapter"=>"sqlite3", "pool"=>5, "timeout"=>5000}, "development"=>{"adapter"=>"sqlite3", "pool"=>5, "timeout"=>5000, "database"=>"db/development.sqlite3"}, "test"=>{"adapter"=>"sqlite3", "pool"=>5, "timeout"=>5000, "database"=>"db/test.sqlite3"}, "production"=>{"adapter"=>"sqlite3", "pool"=>5, "timeout"=>5000, "database"=>"db/production.sqlite3"}} - Rails.application.config.database_configuration - # system('bash') - exec('bash') + DBShell::Sqlite3Client.runshell( + Rails.application.config.database_configuration['development'] + ) end |