Path: | lib/sequel/extensions/query.rb |
Last Update: | Sat Jun 02 02:04:22 +0000 2018 |
frozen-string-literal: true
The query extension adds a query method which allows a different way to construct queries instead of the usual method chaining:
dataset = DB[:items].query do select :x, :y, :z where{(x > 1) & (y > 2)} reverse :z end
You can load this extension into specific datasets:
ds = DB[:table] ds = ds.extension(:query)
Or you can load it into all of a database‘s datasets, which is probably the desired behavior if you are using this extension:
DB.extension(:query)
Related modules: Sequel::DatabaseQuery, Sequel::DatasetQuery, Sequel::Dataset::Query