-
-
Notifications
You must be signed in to change notification settings - Fork 88
SQL Source
Thibaut Barrère edited this page Apr 16, 2017
·
9 revisions
Kiba Pro SQL
source provides an efficient way to read large volumes of rows.
Currently tested against: PostgreSQL 9.2-9.6.
Here is a typical use:
source Kiba::Pro::Sources::SQL,
database: ENV.fetch('DATABASE_URL'),
query: "SELECT * FROM items"
You can also specify the query using Sequel, for instance:
source Kiba::Pro::Sources::SQL,
database: ENV.fetch('DATABASE_URL'),
query: -> (db) { db[:items].where('updated_at >= ?', last_updated_at).limit(1000) }
Finally, if you are using Kiba inside Sidekiq, you can pass a live connection rather than a database_url:
job = Kiba.parse do
source Kiba::Pro::Sources::SQL,
database: db,
query: "SELECT * FROM items"
# SNIP
end
Kiba.run(job)
Home | Core Concepts | Defining jobs | Running jobs | Writing sources | Writing transforms | Writing destinations | Implementation Guidelines | Kiba Pro
This wiki is tracked by git and publicly editable. You are welcome to fix errors and typos. Any defacing or vandalism of content will result in your changes being reverted and you being blocked.