My app, must work with multiple db's for many reasons. I work on custom model for db connection establishing, where I need to establish new db connection, based on arg's, . So, for example, before establishing new connection using:
ActiveRecord::Base.establish_connection new_config
Where new_config
is customized clone, of database.yml
I want to check whether new DB exists before any db connections establishing. So I need a function db_exists? db_name
that will return boolean value, based on whether db exists or not.