Class: Ductr::Postgres::BufferedDestination

Inherits:
ETL::BufferedDestination
  • Object
show all
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

See Also:

  • Ductr::ETL::BufferedDestination

Instance Method Summary collapse

Instance Method Details

#on_flushvoid

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