class Avram::QueryBuilder
- Avram::QueryBuilder
- Reference
- Object
Defined in:
avram/query_builder.crConstructors
Instance Method Summary
- #args
- #args_for_update(params)
-
#clear_conjunction
Clears the last conjunction e.g.
-
#clone
Returns a copy of
self
with all instance variables cloned. - #delete
- #distinct
- #distinct?
- #distinct_on(column : ColumnName)
- #distinct_on : ColumnName | Nil
- #group_by(column : ColumnName)
- #group_sql
- #grouped?
- #groups : Array(String | Symbol)
- #has_distinct_on?
- #join(join_clause : Avram::Join::SqlClause)
- #joins
- #limit(limit : Int32 | Nil)
- #limit : Int32?
-
#merge(query_to_merge : Avram::QueryBuilder)
Merges the wheres, joins, and orders from the passed in query
- #offset(offset : Int32 | Nil)
- #offset : Int32?
- #or(&block : Avram::QueryBuilder -> Avram::QueryBuilder)
- #order_by(order : OrderByClause)
- #order_sql
- #ordered?
- #ordered_randomly?
- #orders
- #random_order
-
#remove_last_where
Removes the last
Avram::Where
to be added - #reset_order
- #reset_where(column : ColumnName)
- #reverse_order
- #select(selection : Array(ColumnName))
- #select(selections : String)
- #select_average(column : ColumnName)
- #select_count
- #select_direct(selection : Array(ColumnName))
- #select_max(column : ColumnName)
- #select_min(column : ColumnName)
- #select_sum(column : ColumnName)
- #selects
- #statement
- #statement!
- #statement_for_update(params, return_columns returning? : Bool = true)
- #statement_for_update!(params, return_columns returning? : Bool = true)
- #table : TableName
-
#to_prepared_sql : String
Prepares the SQL statement by combining the
#args
and#statement
in to a singleString
- #to_sql
- #where(where_clause : Avram::Where::Condition)
- #wheres : Array(Avram::Where::Condition)
Instance methods inherited from class Object
blank_for_validates_required? : Bool
blank_for_validates_required?
Constructor Detail
Instance Method Detail
def merge(query_to_merge : Avram::QueryBuilder)
#
Merges the wheres, joins, and orders from the passed in query
Prepares the SQL statement by combining the #args
and #statement
in to a single String