class Granite::Query::Builder(Model)

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:

Hopefully soon:

Defined in:

granite/query/builder.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(db_type : Granite::Query::Builder::DbType, boolean_operator : Symbol = :and) #

[View source]

Instance Method Detail

def and(field : Symbol | String, operator : Symbol, value : Granite::Columns::Type) #

[View source]
def and(stmt : String, value : Granite::Columns::Type = nil) #

[View source]
def and(matches) #

[View source]
def and(**matches) #

[View source]
def any? : Bool #

[View source]
def assembler : Assembler::Base(Model) #

[View source]
def count #

[View source]
def db_type : DbType #

[View source]
def delete #

[View source]
def each(&) #

[View source]
def exists? : Bool #

[View source]
def group_by(field : Symbol) #

[View source]
def group_by(fields : Array(Symbol)) #

[View source]
def group_by(dsl) #

[View source]
def group_by(**dsl) #

[View source]
def group_fields #

[View source]
def limit(num) #

[View source]
def limit : Int64 | Nil #

[View source]
def map(&) #

[View source]
def offset(num) #

[View source]
def offset : Int64 | Nil #

[View source]
def or(field : Symbol | String, operator : Symbol, value : Granite::Columns::Type) #

[View source]
def or(stmt : String, value : Granite::Columns::Type = nil) #

[View source]
def or(matches) #

[View source]
def or(**matches) #

[View source]
def order(field : Symbol) #

[View source]
def order(fields : Array(Symbol)) #

[View source]
def order(dsl) #

[View source]
def order(**dsl) #

[View source]
def order_fields #

[View source]
def raw_sql #

[View source]
def reject(&) #

[View source]
def select #

[View source]
def size #

[View source]
def where(field : Symbol | String, operator : Symbol, value : Granite::Columns::Type) #

[View source]
def where(stmt : String, value : Granite::Columns::Type = nil) #

[View source]
def where(matches) #

[View source]
def where(**matches) #

[View source]
def where_fields #

[View source]