Class: Janko::InsertImporter
- Inherits:
-
Object
- Object
- Janko::InsertImporter
- Includes:
- Agrippa::Mutable
- Defined in:
- lib/janko/insert_importer.rb
Instance Method Summary collapse
Instance Method Details
#push(values) ⇒ Object
16 17 18 19 |
# File 'lib/janko/insert_importer.rb', line 16 def push(values) connection.exec_prepared(statement_name, columns.pack(values)) self end |
#start ⇒ Object
9 10 11 12 13 14 |
# File 'lib/janko/insert_importer.rb', line 9 def start query = sprintf("INSERT INTO %s(%s) VALUES(%s)", table, columns.to_list, columns.to_binds) connection.prepare(statement_name, query) self end |
#stop ⇒ Object
21 22 23 24 |
# File 'lib/janko/insert_importer.rb', line 21 def stop connection.exec("DEALLOCATE \"#{statement_name}\"") self end |