title: How do I get the current database object in Sequel running with Rails?
body: <p>I need to get the current database object from Sequel in a Rails application. I cannot define it for various reasons, like it is advised in "<a href="https://stackoverflow.com/questions/13593295/transactions-in-ruby-sequel-module-how-to-get-db-object">Transactions in Ruby Sequel module: how to get DB object?</a>". My database uses JDBC defined in database.yml.</p>
  
  <p>I can get <code>Database.current</code>, but it seems I can't do any operation on it, like add a logger, like I can do on DB object defined for Sequel in another app:</p>
  
  <pre><code>lger = Logger.new(STDOUT)
  DB.sql_log_level = :debug
  DB.loggers &lt;&lt; lger
  </code></pre>
  
  <p>Doing this on <code>Database.current</code> or <code>Database.current()</code> causes "no such method" exceptions, so I need to get the actual DB object used by Sequel.</p>