Class: Boxcars::SQLActiveRecord
- Inherits:
-
SQLBase
- Object
- Boxcar
- EngineBoxcar
- SQLBase
- Boxcars::SQLActiveRecord
- Defined in:
- lib/boxcars/boxcar/sql_active_record.rb
Overview
A Boxcar that interprets a prompt and executes SQL code using Active Record to get answers
Constant Summary
Constants inherited from SQLBase
Boxcars::SQLBase::LOCKED_OUT_TABLES, Boxcars::SQLBase::SQLDESC
Instance Attribute Summary
Attributes inherited from SQLBase
Attributes inherited from EngineBoxcar
#engine, #prompt, #stop, #top_k
Attributes inherited from Boxcar
#description, #name, #parameters, #return_direct
Instance Method Summary collapse
-
#initialize(connection: nil, tables: nil, except_tables: nil, **kwargs) ⇒ SQLActiveRecord
constructor
A new instance of SQLActiveRecord.
Methods inherited from SQLBase
Methods inherited from EngineBoxcar
#apply, #call, #check_output_keys, #extract_code, #generate, #input_key, #input_keys, #output_key, #output_keys, #predict, #prediction_additional, #prediction_input, #prediction_variables
Methods inherited from Boxcar
#apply, assi, #call, #conduct, hist, #input_keys, #load, #output_keys, #run, #save, #schema, syst, user, #validate_inputs, #validate_outputs
Constructor Details
#initialize(connection: nil, tables: nil, except_tables: nil, **kwargs) ⇒ SQLActiveRecord
Returns a new instance of SQLActiveRecord.
12 13 14 15 |
# File 'lib/boxcars/boxcar/sql_active_record.rb', line 12 def initialize(connection: nil, tables: nil, except_tables: nil, **kwargs) connection ||= ::ActiveRecord::Base.connection super end |