Class: YeSQL::Query::Performer

Inherits:
Object
  • Object
show all
Includes:
Bindings::Utils
Defined in:
lib/yesql/query/performer.rb

Instance Method Summary collapse

Methods included from Bindings::Utils

#statement_binds

Methods included from Utils::Read

#statement

Constructor Details

#initialize(bind_statement:, file_path:, bindings: {}, output: :rows, prepare: false) ⇒ Performer

Returns a new instance of Performer.



16
17
18
19
20
21
22
# File 'lib/yesql/query/performer.rb', line 16

def initialize(bind_statement:, file_path:, bindings: {}, output: :rows, prepare: false)
  @bind_statement = bind_statement
  @file_path = file_path
  @named_bindings = bindings.transform_keys(&:to_sym)
  @output = ::YeSQL::Params::Output.new(output)
  @prepare = prepare
end

Instance Method Details

#callObject



24
25
26
# File 'lib/yesql/query/performer.rb', line 24

def call
  ::YeSQL::Query::TransformResult.new(output: output, result: query_result).call
end