Class: BeetleETL::Import
- Inherits:
-
Object
- Object
- BeetleETL::Import
- Defined in:
- lib/beetle_etl/import.rb
Instance Method Summary collapse
Instance Method Details
#cleanup ⇒ Object
28 29 30 31 32 |
# File 'lib/beetle_etl/import.rb', line 28 def cleanup transformations.each do |t| DropStage.new(t.table_name).run end end |
#import ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/beetle_etl/import.rb', line 19 def import data_report = AsyncStepRunner.new(data_steps).run load_report = BeetleETL.database.transaction do AsyncStepRunner.new(load_steps).run end data_report.deep_merge load_report end |
#run ⇒ Object
6 7 8 9 10 11 |
# File 'lib/beetle_etl/import.rb', line 6 def run setup import ensure cleanup end |
#setup ⇒ Object
13 14 15 16 17 |
# File 'lib/beetle_etl/import.rb', line 13 def setup transformations.each do |t| CreateStage.new(t.table_name, t.relations, t.column_names).run end end |