class DBX::Adapter::PGQueryBuilder

Overview

QueryBuilder for PostgreSQL. :inherit:

Defined in:

adapter/pg.cr

Constant Summary

QUOTE = '"'

Instance Method Summary

Instance methods inherited from class DBX::QueryBuilder

add_arg(value) : String add_arg, add_args_and_fields_from_data(data : NamedTuple | Hash, sep = ", ") : String
add_args_and_fields_from_data(data : Array, sep = ", ") : String
add_args_and_fields_from_data
, add_args_and_kv_from_data(data : NamedTuple | Hash, sep = ", ") : String add_args_and_kv_from_data, alter(command : String, field : String, data_type = "") : QueryBuilder
alter(table : OneOrMoreFieldsType, command : String, field : String, data_type = "") : QueryBuilder
alter
, analyze(table : OneOrMoreFieldsType) : QueryBuilder
analyze : QueryBuilder
analyze
, avg(field : FieldType, name = nil) : QueryBuilder avg, between(field : FieldType, value1, value2, type = "", and_or = "AND") : QueryBuilder between, build : SQLandArgsType build, check(table : OneOrMoreFieldsType) : QueryBuilder
check : QueryBuilder
check
, checksum(table : OneOrMoreFieldsType) : QueryBuilder
checksum : QueryBuilder
checksum
, count(field : FieldType, name = nil) : QueryBuilder count, delete(pk_name, pk_value) : QueryBuilder
delete(table : OneOrMoreFieldsType) : QueryBuilder
delete : QueryBuilder
delete
, drop(table : OneOrMoreFieldsType, check_exists = true) : QueryBuilder
drop(check_exists : Bool | NamedTuple(command: String, field: String, data_type: String) | Nil = true) : QueryBuilder
drop
, find(pk_name, pk_value) : QueryBuilder
find(table_name : OneOrMoreFieldsType) : QueryBuilder
find : QueryBuilder
find(&) : QueryBuilder
find
, full_join(table : FieldType, field1 : FieldType, field2 : FieldType | Nil = nil) : QueryBuilder full_join, full_outer_join(table : FieldType, field1 : FieldType, field2 : FieldType | Nil = nil) : QueryBuilder full_outer_join, group_by(field : OneOrMoreFieldsType) : QueryBuilder group_by, having(field : FieldType, op_or_val, value = nil) : QueryBuilder
having(&) : QueryBuilder
having
, in(field : FieldType, values : Array | Tuple, type = "", and_or = "AND") : QueryBuilder in, inner_join(table : FieldType, field1 : FieldType, field2 : FieldType | Nil = nil) : QueryBuilder inner_join, insert(table : OneOrMoreFieldsType, data : Hash | NamedTuple) : QueryBuilder
insert(data : Hash | NamedTuple) : QueryBuilder
insert
, join(table : FieldType, field1 : FieldType, field2 : FieldType | Nil = nil, type = "") : QueryBuilder
join(&) : QueryBuilder
join : String
join
, last_query : String last_query, last_query_method : Symbol | Nil last_query_method, left_join(table : FieldType, field1 : FieldType, field2 : FieldType | Nil = nil) : QueryBuilder left_join, left_outer_join(table : FieldType, field1 : FieldType, field2 : FieldType | Nil = nil) : QueryBuilder left_outer_join, like(field : FieldType, value, type = "", and_or = "AND") : QueryBuilder like, limit(limit, limit_end = nil) : QueryBuilder
limit : String
limit
, max(field : FieldType, name = nil) : QueryBuilder max, min(field : FieldType, name = nil) : QueryBuilder min, not_between(field : FieldType, value1, value2) : QueryBuilder not_between, not_in(field : FieldType, values : Array | Tuple) : QueryBuilder not_in, not_like(field : FieldType, value) : QueryBuilder not_like, not_where(field : FieldType, op_or_val, value = nil) : QueryBuilder not_where, offset(offset) : QueryBuilder
offset : String
offset
, optimize(table : OneOrMoreFieldsType) : QueryBuilder
optimize : QueryBuilder
optimize
, or_between(field : FieldType, value1, value2) : QueryBuilder or_between, or_in(field : FieldType, values : Array | Tuple) : QueryBuilder or_in, or_like(field : FieldType, value) : QueryBuilder or_like, or_not_between(field : FieldType, value1, value2) : QueryBuilder or_not_between, or_not_in(field : FieldType, values : Array | Tuple) : QueryBuilder or_not_in, or_not_like(field : FieldType, value) : QueryBuilder or_not_like, or_not_where(field : FieldType, op_or_val, value = nil) : QueryBuilder or_not_where, or_where(field : FieldType, op_or_val, value = nil) : QueryBuilder or_where, order_by(field : FieldType, dir = nil) : QueryBuilder order_by, paginate(per_page, page) : QueryBuilder paginate, ph(position : Int) : String ph, query(&) : QueryBuilder query, query_count : Int query_count, query_method : Symbol | Nil query_method, quote(field : FieldType) : String quote, repair(table : OneOrMoreFieldsType) : QueryBuilder
repair : QueryBuilder
repair
, reset_query reset_query, returning(fields : OneOrMoreFieldsType) : QueryBuilder
returning : String | Nil
returning(*name : FieldType) : QueryBuilder
returning
, right_join(table : FieldType, field1 : FieldType, field2 : FieldType | Nil = nil) : QueryBuilder right_join, right_outer_join(table : FieldType, field1 : FieldType, field2 : FieldType | Nil = nil) : QueryBuilder right_outer_join, select(fields : OneOrMoreFieldsType) : QueryBuilder
select : String
select(*name : FieldType) : QueryBuilder
select
, sum(field : FieldType, name = nil) : QueryBuilder sum, table(name : OneOrMoreFieldsType) : QueryBuilder
table : String
table(*name : FieldType) : QueryBuilder
table(&) : QueryBuilder
table
, to_data_h(data : Hash | NamedTuple) : DataHashType to_data_h, update(pk_name, pk_value, data : Hash | NamedTuple) : QueryBuilder
update(table : OneOrMoreFieldsType, data : Hash | NamedTuple) : QueryBuilder
update(data : Hash | NamedTuple) : QueryBuilder
update
, where(field : FieldType, op_or_val, value = nil, type = "", and_or = "AND") : QueryBuilder
where(&) : QueryBuilder
where

Constructor methods inherited from class DBX::QueryBuilder

new new

Instance Method Detail

def ph(position : Int) #

Adds placeholder specific to PostgreSQL. Adds placeholder for a SQL argument.


[View source]