Class: Ductr::Postgres::BufferedUpsertDestination
- Inherits:
-
ETL::BufferedDestination
- Object
- ETL::BufferedDestination
- Ductr::Postgres::BufferedUpsertDestination
- Defined in:
- lib/ductr/postgres/buffered_upsert_destination.rb
Overview
A destination control that accumulates rows in a buffer to upsert them by batch, registered as :buffered_upsert
.
Accept the :buffer_size
option, default value is 10 000:
destination :some_postgres_database, :buffered_upsert, buffer_size: 42 def my_destination(buffer, excluded, db) db[:items].insert_conflict(target: :id, update: excluded).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_upsert_destination.rb', line 24 def on_flush call_method(adapter.db, excluded, buffer) end |