Class: DbFuel::Library::Dbee::Query
- Defined in:
- lib/db_fuel/library/dbee/query.rb
Overview
Instance Attribute Summary
Attributes inherited from Base
#debug, #model, #provider, #query
Instance Method Summary collapse
-
#initialize(name: '', model: {}, query: {}, register: Burner::DEFAULT_REGISTER, debug: false) ⇒ Query
constructor
Arguments: - name: Name of job.
- #perform(output, payload) ⇒ Object
Constructor Details
#initialize(name: '', model: {}, query: {}, register: Burner::DEFAULT_REGISTER, debug: false) ⇒ Query
Arguments:
-
name: Name of job.
-
model: Dbee Model configuration
-
query: Dbee Query configuration
-
register: Name of the register to use for gathering the IN clause values and where
to store the resulting recordset. -
debug: If debug is set to true (defaults to false) then the SQL statements
will be printed in the output. Only use this option while debugging issues as it will fill up the output with (potentially too much) data.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/db_fuel/library/dbee/query.rb', line 33 def initialize( name: '', model: {}, query: {}, register: Burner::DEFAULT_REGISTER, debug: false ) super( model: model, name: name, query: query, register: register, debug: debug ) end |
Instance Method Details
#perform(output, payload) ⇒ Object
49 50 51 52 53 |
# File 'lib/db_fuel/library/dbee/query.rb', line 49 def perform(output, payload) records = execute(sql(output)) load_register(records, output, payload) end |