Module: Populator::Adapters::Abstract
- Defined in:
- lib/populator/adapters/abstract.rb
Instance Method Summary collapse
-
#execute_batch(sql, name = nil) ⇒ Object
Executes multiple SQL statements in one query when joined with “;”.
- #populate(table, columns, rows, name = nil) ⇒ Object
Instance Method Details
#execute_batch(sql, name = nil) ⇒ Object
Executes multiple SQL statements in one query when joined with “;”
5 6 7 |
# File 'lib/populator/adapters/abstract.rb', line 5 def execute_batch(sql, name = nil) raise NotImplementedError, "execute_batch is an abstract method" end |
#populate(table, columns, rows, name = nil) ⇒ Object
9 10 11 |
# File 'lib/populator/adapters/abstract.rb', line 9 def populate(table, columns, rows, name = nil) execute("INSERT INTO #{table} #{columns} VALUES #{rows.join(', ')}", name) end |