module Filterable

Overview

Handles WHERE and HAVING clauses.

Defined in:

query/filtrable.cr

Instance Method Summary

Instance Method Detail

def having(&) #

Adds a HAVING condition using a block.

Example Adding a HAVING condition using a block

query.having { name == "John" && age > 30 }
=> #<CQL::Query:0x00007f8000000000>

[View source]
def where(hash : Hash(String | Symbol, DB::Any)) #

Adds a WHERE condition using a Hash.

Example Adding a WHERE condition using a Hash

query.where(name: "John", age: 30)
=> #<CQL::Query:0x00007f8000000000>

[View source]
def where(&) #

Adds a WHERE condition using a block.

Example Adding a WHERE condition using a block

query.where { name == "John" && age > 30 }
=> #<CQL::Query:0x00007f8000000000>

[View source]
def where(**fields) #

Adds a WHERE condition using keyword arguments.

Example Adding a WHERE condition using keyword arguments

query.where(name: "John", age: 30)
=> #<CQL::Query:0x00007f8000000000>

[View source]