class Change::SQL::Query

Defined in:

change/sql/query.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def from(source : String) : self #

[View source]
def froms : Array(Change::SQL::FromExpr) #

[View source]
def froms=(froms : Array(Change::SQL::FromExpr)) #

[View source]
def limit(number) : self #

[View source]
def limit : Int32 | Nil #

def limit=(limit : Int32 | Nil) #

[View source]
def limit? : Int32 | Nil | Nil #

def offset(number) : self #

[View source]
def offset : Int32 | Nil #

def offset=(offset : Int32 | Nil) #

[View source]
def offset? : Int32 | Nil | Nil #

def only_from(source : String) : self #

[View source]
def only_order(orders) : self #

[View source]
def only_select(columns : Array) : self #

The only_ methods are clones of all the other methods, but clear out any other existing entries in that expression list beforehand.

Using these methods can guarantee that values are controlled and not composed with any previous values.


[View source]
def only_update(updates) : self #

[View source]
def only_where(conditions) : self #

[View source]
def order(orders) : self #

[View source]
def order(**orders) : self #

[View source]
def orders : Array(Change::SQL::OrderExpr) #

[View source]
def orders=(orders : Array(Change::SQL::OrderExpr)) #

[View source]
def select(columns : Array) : self #

[View source]
def selects : Array(Change::SQL::SelectExpr) #

[View source]
def selects=(selects : Array(Change::SQL::SelectExpr)) #

[View source]
def update(updates) : self #

[View source]
def update(**conditions) : self #

[View source]
def updates : Array(Change::SQL::UpdateExpr) #

[View source]
def updates=(updates : Array(Change::SQL::UpdateExpr)) #

[View source]
def where(conditions) : self #

[View source]
def where(**conditions) : self #

[View source]
def wheres : Array(Change::SQL::WhereExpr) #

Currently all ANDd together


[View source]
def wheres=(wheres : Array(Change::SQL::WhereExpr)) #

Currently all ANDd together


[View source]
def without_limit : self #

LIMIT and OFFSET do not have only_ methods, since they can only contain a single value to start with. Instead, they have without methods to remove any existing value


[View source]
def without_offset : self #

[View source]