class Granite::Query::Builder(Model)
- Granite::Query::Builder(Model)
- Reference
- Object
Overview
Data structure which will allow chaining of query components, nesting of boolean logic, etc.
Should return self, or another instance of Builder wherever chaining should be possible.
Current query syntax:
- where(field: value) => "WHERE field = 'value'"
Hopefully soon:
-
Model.where(field: value).not( Model.where(field2: value2) ) or
-
Model.where(field: value).not { where(field2: value2) }
-
Model.where(field: value).or( Model.where(field3: value3) ) or
-
Model.where(field: value).or { whehre(field3: value3) }
Defined in:
granite/query/builder.crConstructors
Instance Method Summary
- #and(field : Symbol | String, operator : Symbol, value : Granite::Columns::Type)
- #and(stmt : String, value : Granite::Columns::Type = nil)
- #and(matches)
- #and(**matches)
- #any? : Bool
- #assembler : Assembler::Base(Model)
- #count
- #db_type : DbType
- #delete
- #each(&)
- #exists? : Bool
- #group_by(field : Symbol)
- #group_by(fields : Array(Symbol))
- #group_by(dsl)
- #group_by(**dsl)
- #group_fields
- #limit(num)
- #limit : Int64 | Nil
- #map(&)
- #offset(num)
- #offset : Int64 | Nil
- #or(field : Symbol | String, operator : Symbol, value : Granite::Columns::Type)
- #or(stmt : String, value : Granite::Columns::Type = nil)
- #or(matches)
- #or(**matches)
- #order(field : Symbol)
- #order(fields : Array(Symbol))
- #order(dsl)
- #order(**dsl)
- #order_fields
- #raw_sql
- #reject(&)
- #select
- #size
- #where(field : Symbol | String, operator : Symbol, value : Granite::Columns::Type)
- #where(stmt : String, value : Granite::Columns::Type = nil)
- #where(matches)
- #where(**matches)
- #where_fields
Constructor Detail
Instance Method Detail
def where(field : Symbol | String, operator : Symbol, value : Granite::Columns::Type)
#