class

Avram::QueryBuilder

Inherits Reference < Object

Constructors

new(table : String | Symbol)
Source

Instance methods

args
Source
args_for_update(params)
Source
clear_conjunction

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

Source
clone

Returns a copy of self with all instance variables cloned.

Source
delete
Source
distinct
Source
distinct?
Source
distinct_on(column : ColumnName) : self
Source
distinct_on
Source
for_update
Source
group_by(column : ColumnName) : self
Source
group_sql
Source
grouped?
Source
groups
Source
has_distinct_on?
Source
join(join_clause : Avram::Join::SqlClause) : self
Source
joins
Source
limit(limit : Int32 | Nil) : self
Source
limit
Source
merge(query_to_merge : Avram::QueryBuilder)

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

Source
offset(offset : Int32 | Nil) : self
Source
offset
Source
order_by(order : OrderByClause) : self
Source
order_sql
Source
ordered?
Source
ordered_randomly?
Source
orders
Source
random_order
Source
remove_last_where

Removes the last Avram::Where to be added

Source
reset_order
Source
reset_where(column : ColumnName) : self
Source
reverse_order
Source
select(selection : Array(ColumnName)) : self
Source
select(selections : String) : self
Source
select_average(column : ColumnName) : self
Source
select_count
Source
select_direct(selection : Array(ColumnName)) : self
Source
select_max(column : ColumnName) : self
Source
select_min(column : ColumnName) : self
Source
select_sum(column : ColumnName) : self
Source
selects
Source
statement
Source
statement!
Source
statement_for_update(params, return_columns returning : Bool = true)
Source
statement_for_update!(params, return_columns returning : Bool = true)

Creates the SQL for updating. If any joins are present, it moves the WHERE clause to a subquery allowing for joins

Source
table
Source
to_prepared_sql

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

Source
to_sql
Source
where(where_clause : Avram::Where::Condition) : self
Source
wheres
Source

Nested types