aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dbshell/rails/tasks/dbshell.rake
blob: 44d794835c162d84e33d22ed24b9f1591f571f7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'dbshell/client/database'

task :dbshell do
  env = ENV.fetch('RAILS_ENV', 'development')

  DBShell::Client::Database.runshell(
    Rails.application.config.database_configuration[env]
  )
end

# Alias 'dbshell' to 'db:shell'
namespace :db do
  task shell: :dbshell
end