Class: RedshiftConnector::ActiveRecordDataSource
- Inherits:
-
Object
- Object
- RedshiftConnector::ActiveRecordDataSource
- Defined in:
- lib/redshift_connector/active_record_data_source.rb
Class Method Summary collapse
Instance Method Summary collapse
- #execute_query(query_str) ⇒ Object
- #exporter_builder ⇒ Object
-
#initialize(dao) ⇒ ActiveRecordDataSource
constructor
A new instance of ActiveRecordDataSource.
Constructor Details
#initialize(dao) ⇒ ActiveRecordDataSource
Returns a new instance of ActiveRecordDataSource.
9 10 11 |
# File 'lib/redshift_connector/active_record_data_source.rb', line 9 def initialize(dao) @dao = dao end |
Class Method Details
.for_dao(dao) ⇒ Object
5 6 7 |
# File 'lib/redshift_connector/active_record_data_source.rb', line 5 def ActiveRecordDataSource.for_dao(dao) new(dao) end |
Instance Method Details
#execute_query(query_str) ⇒ Object
17 18 19 20 21 |
# File 'lib/redshift_connector/active_record_data_source.rb', line 17 def execute_query(query_str) @dao.connection_pool.with_connection {|conn| conn.execute(query_str) } end |
#exporter_builder ⇒ Object
13 14 15 |
# File 'lib/redshift_connector/active_record_data_source.rb', line 13 def exporter_builder ExporterBuilder.new(ds: self, exporter_class: ActiveRecordExporter) end |