Class: DBA::Pull
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
Methods inherited from Command
Constructor Details
This class inherits a constructor from DBA::Command
Instance Method Details
#call(table, url) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/dba/pull.rb', line 2 def call(table, url) self.table_name = table dataset = database[table_name] other_database = Sequel.connect(url) database.transaction do other_database[table_name].each { |row| dataset.insert(row) } end end |