Class: Ductr::Postgres::BufferedDestination
- Inherits:
-
ETL::BufferedDestination
- Object
- ETL::BufferedDestination
- Ductr::Postgres::BufferedDestination
- Defined in:
- lib/ductr/postgres/buffered_destination.rb
Overview
A destination control that accumulates rows in a buffer to write them by batch, registered as :buffered
.
Accept the :buffer_size
option, default value is 10 000:
destination :some_postgres_database, :buffered, buffer_size: 42 def my_destination(db, buffer) db[:items].multi_insert(buffer) end
Instance Method Summary collapse
-
#on_flush ⇒ void
Open the database if needed and call the job's method to run the query.
Instance Method Details
#on_flush ⇒ void
This method returns an undefined value.
Open the database if needed and call the job's method to run the query.
24 25 26 |
# File 'lib/ductr/postgres/buffered_destination.rb', line 24 def on_flush call_method(adapter.db, buffer) end |