class Avram::QueryBuilder

Defined in:

avram/query_builder.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

blank_for_validates_required? : Bool blank_for_validates_required?

Constructor Detail

def self.new(table : String | Symbol) #

[View source]

Instance Method Detail

def args #

[View source]
def args_for_update(params) #

[View source]
def clear_conjunction #

Clears the last conjunction e.g. users.age = $1 AND -> users.age = $1


[View source]
def clone #

Returns a copy of self with all instance variables cloned.


[View source]
def delete #

[View source]
def distinct #

[View source]
def distinct? #

[View source]
def distinct_on(column : ColumnName) #

[View source]
def distinct_on : ColumnName | Nil #

[View source]
def group_by(column : ColumnName) #

[View source]
def group_sql #

[View source]
def grouped? #

[View source]
def groups : Array(String | Symbol) #

[View source]
def has_distinct_on? #

[View source]
def join(join_clause : Avram::Join::SqlClause) #

[View source]
def joins #

[View source]
def limit(limit : Int32 | Nil) #

[View source]
def limit : Int32? #

[View source]
def merge(query_to_merge : Avram::QueryBuilder) #

Merges the wheres, joins, and orders from the passed in query


[View source]
def offset(offset : Int32 | Nil) #

[View source]
def offset : Int32? #

[View source]

[View source]
def order_by(order : OrderByClause) #

[View source]
def order_sql #

[View source]
def ordered? #

[View source]
def ordered_randomly? #

[View source]
def orders #

[View source]
def random_order #

[View source]
def remove_last_where #

Removes the last Avram::Where to be added


[View source]
def reset_order #

[View source]
def reset_where(column : ColumnName) #

[View source]
def reverse_order #

[View source]
def select(selection : Array(ColumnName)) #

[View source]
def select(selections : String) #

[View source]
def select_average(column : ColumnName) #

[View source]
def select_count #

[View source]
def select_direct(selection : Array(ColumnName)) #

[View source]
def select_max(column : ColumnName) #

[View source]
def select_min(column : ColumnName) #

[View source]
def select_sum(column : ColumnName) #

[View source]
def selects #

[View source]
def statement #

[View source]
def statement! #

[View source]
def statement_for_update(params, return_columns returning? : Bool = true) #

[View source]
def statement_for_update!(params, return_columns returning? : Bool = true) #

[View source]
def table : TableName #

[View source]
def to_prepared_sql : String #

Prepares the SQL statement by combining the #args and #statement in to a single String


[View source]
def to_sql #

[View source]
def where(where_clause : Avram::Where::Condition) #

[View source]

[View source]