Class: Ductr::Postgres::BasicLookup

Inherits:
SequelBase::BasicLookup
  • Object
show all
Defined in:
lib/ductr/postgres/basic_lookup.rb

Overview

A lookup control that execute one query per row, registered as :basic. The job's method must return a row which will merged with the current row:

lookup :some_postgres_database, :basic def my_lookup(db, row) db[:items_bis].where(item: row[:id]).limit(1) end

As the control merge the looked up row with the current row, ensure that column names are different or they will be overwritten.

If the lookup returns a falsy value, nothing won't be merged with the current row.