module

Luna::QueryBuilder

Class methods

append_params!(target : Array(DB::Any), vals : Array(DB::Any))
Source
append_params!(target : Array(DB::Any), vals : NamedTuple)
Source
delete_from(table : String, id : DB::Any, pk : String | Symbol = "id") : Delete

DELETE by id

Source
delete_where(table : String, filters : Hash(Symbol, DB::Any)) : Delete

DELETE ... WHERE (both input styles)

Source
delete_where(table : String, filters : NamedTuple) : Delete
Source
insert_into(table : String, data : Hash(Symbol, DB::Any)) : Insert

INSERT

Source
insert_into(table : String, data : NamedTuple) : Insert
Source
ph(n : Int32) : String

Helpers

Source
select_all(table : String) : Select
Source
select_by(table : String, filters : Hash(Symbol, DB::Any)) : Select

filters: Hash

Source
select_by(table : String, filters : NamedTuple) : Select

filters: NamedTuple

Source
select_by_id(table : String, id : DB::Any, pk : String | Symbol = "id") : Select
Source
select_by_statement(table : String, stmt : String, vals : Array(DB::Any)) : Select

stmt + params: Array

Source
select_by_statement(table : String, stmt : String, vals : NamedTuple) : Select

stmt + params: NamedTuple

Source
update(table : String, data : Hash(Symbol, DB::Any), id : DB::Any, pk : String | Symbol = "id") : Update

UPDATE (by id)

Source
update(table : String, data : NamedTuple, id : DB::Any, pk : String | Symbol = "id") : Update
Source
update_where(table : String, data : Hash(Symbol, DB::Any), filters : Hash(Symbol, DB::Any)) : Update

UPDATE ... WHERE (all combos)

Source
update_where(table : String, data : Hash(Symbol, DB::Any), filters : NamedTuple) : Update
Source
update_where(table : String, data : NamedTuple, filters : Hash(Symbol, DB::Any)) : Update
Source
update_where(table : String, data : NamedTuple, filters : NamedTuple) : Update
Source

Nested types