module Modifiable
Overview
Handles query modifiers like ORDER BY, GROUP BY, LIMIT, OFFSET.
Defined in:
query/modifyable.crInstance Method Summary
-
#group(*columns : Symbol | String)
Specifies the columns to group by.
-
#limit(value : Int32)
Sets the limit for the number of records to return.
-
#offset(value : Int32)
Sets the offset for the query.
-
#order(*fields : Symbol | String)
Specifies the columns to order by (ASC implicitly).
-
#order(**fields)
Specifies the columns to order by with direction.
Instance Method Detail
def group(*columns : Symbol | String)
#
Specifies the columns to group by.
Example Specifying the columns to group by
query.group(:name, :age)
def limit(value : Int32)
#
Sets the limit for the number of records to return.
Example Setting the limit for the number of records to return
query.limit(10)
def offset(value : Int32)
#
Sets the offset for the query.
Example Setting the offset for the query
query.offset(10)
def order(*fields : Symbol | String)
#
Specifies the columns to order by (ASC implicitly).
Example Specifying the columns to order by
query.order(:name, :age)
def order(**fields)
#
Specifies the columns to order by with direction.
Example Specifying the columns to order by with direction
query.order(name: :asc, age: :desc)