Class: Adhoq::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/adhoq/executor.rb,
lib/adhoq/executor/connection_wrapper.rb

Defined Under Namespace

Classes: ConnectionWrapper

Instance Method Summary collapse

Constructor Details

#initialize(query) ⇒ Executor

Returns a new instance of Executor.



5
6
7
8
# File 'lib/adhoq/executor.rb', line 5

def initialize(query)
  @connection = ConnectionWrapper.new
  @query = query
end

Instance Method Details

#executeObject



10
11
12
# File 'lib/adhoq/executor.rb', line 10

def execute
  wrap_result(@connection.select(@query))
end

#explainObject



14
15
16
# File 'lib/adhoq/executor.rb', line 14

def explain
  @connection.explain(@query)
end