Module: NoBrainer::QueryRunner
- Extended by:
- Autoload
- Defined in:
- lib/no_brainer/query_runner.rb
Defined Under Namespace
Classes: ConnectionLock, DatabaseOnDemand, Driver, EMDriver, Middleware, MissingIndex, Profiler, Reconnect, RunOptions, TableOnDemand, WriteError
Class Method Summary
collapse
Methods included from Autoload
autoload, autoload_and_include, eager_autoload, eager_load!, extended
Class Method Details
.run(*args, &block) ⇒ Object
17
18
19
20
21
22
|
# File 'lib/no_brainer/query_runner.rb', line 17
def run(*args, &block)
options = args.
raise ArgumentError unless args.size == 1 || block
query = args.first || block.call(RethinkDB::RQL.new)
stack.call(:query => query, :options => options)
end
|
.stack ⇒ Object
24
25
26
27
28
29
|
# File 'lib/no_brainer/query_runner.rb', line 24
def stack
case NoBrainer::Config.driver
when :regular then normal_stack
when :em then em_stack
end
end
|