Class: NoBrainer::QueryRunner::Driver

Inherits:
Middleware
  • Object
show all
Defined in:
lib/no_brainer/query_runner/driver.rb

Instance Method Summary collapse

Methods inherited from Middleware

#initialize

Constructor Details

This class inherits a constructor from NoBrainer::QueryRunner::Middleware

Instance Method Details

#call(env) ⇒ Object



2
3
4
5
6
# File 'lib/no_brainer/query_runner/driver.rb', line 2

def call(env)
  options = env[:options]
  options = options.merge(:db => RethinkDB::RQL.new.db(options[:db])) if options[:db]
  env[:query].run(NoBrainer.connection.raw, options)
end