Class: Ductr::Postgres::BufferedUpsertDestination
- Inherits:
-
SequelBase::BufferedUpsertDestination
- Object
- SequelBase::BufferedUpsertDestination
- 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(db, excluded, buffer) db[:items].insert_conflict(target: :id, update: excluded).multi_insert(buffer) end