class Focus::Query
- Focus::Query
- Reference
- Object
Included Modules
- Enumerable(Focus::CachedRow)
Defined in:
focus/query.crConstructors
Instance Method Summary
- #aggregate_columns(aggregation : ColumnDeclaring(T)) : T | Nil forall T
-
#any? : Bool
Returns
true
if at least one of the collection's members is truthy. - #average_by(selector : BaseColumnDeclaring) : Float32 | Nil
- #bind_to(entity : T.class) : Array(T) forall T
- #bind_to_first(entity : T.class) : T forall T
- #bind_to_first?(entity : T.class) : T | Nil forall T
- #bind_to_last(entity : T.class) : T forall T
- #bind_to_last?(entity : T.class) : T | Nil forall T
- #bind_to_one(entity : T.class, at index : Int32) : T forall T
- #bind_to_one?(entity : T.class, at index : Int32) : T | Nil forall T
- #count : Int32
- #database : Focus::Database
- #drop(n : Int32) : Query
-
#each(&block : Focus::CachedRow -> Nil)
Must yield this collection's elements to the block.
- #expression : Focus::SelectExpression
- #group_by(columns : Array(BaseColumnDeclaring)) : Query
- #group_by(*columns : BaseColumnDeclaring) : Query
- #having(condition : ColumnDeclaring(Bool)) : Query
- #limit(offset : Int32 | Nil, limit : Int32 | Nil) : Query
- #limit(limit : Int32) : Query
- #max_by(selector : ColumnDeclaring(T)) : T | Nil forall T
- #min_by(selector : ColumnDeclaring(T)) : T | Nil forall T
-
#none? : Bool
Returns
true
if all of the elements of the collection are falsey. - #offset(offset : Int32) : Query
- #order_by(orders : Array(OrderByExpression)) : Query
- #order_by(*orders : OrderByExpression) : Query
- #result_set : DB::ResultSet
- #rows : Array(Focus::CachedRow)
- #sum_by(selector : ColumnDeclaring(T)) : T | Nil forall T
- #take(n : Int32) : Query
- #to_sql : String
- #where(condition : Focus::ScalarExpression(Bool)) : Focus::Query
- #where_with_conditions(&block : Array(ColumnDeclaring(Bool)) -> Nil) : Focus::Query
- #where_with_or_conditions(&block : Array(ColumnDeclaring(Bool)) -> Nil) : Focus::Query
Constructor Detail
Instance Method Detail
def any? : Bool
#
Description copied from module Enumerable(Focus::CachedRow)
Returns true
if at least one of the collection's members is truthy.
[nil, true, 99].any? # => true
[nil, false].any? # => false
def each(&block : Focus::CachedRow -> Nil)
#
Description copied from module Enumerable(Focus::CachedRow)
Must yield this collection's elements to the block.
def none? : Bool
#
Description copied from module Enumerable(Focus::CachedRow)
Returns true
if all of the elements of the collection are falsey.
[nil, false].none? # => true
[nil, false, true].none? # => false
It's the opposite of all?
.