b_query() = query(iolist())
column() = #mekao_column{}
entity() = tuple() | [term() | '$skip']
iotriple() = iodata() | {iodata(), iodata(), iodata()}
p_query() = query(#mekao_insert{} | #mekao_select{} | #mekao_update{} | #mekao_delete{})
predicate(Val) = Val | {'$predicate', between, Val, Val} | {'$predicate', in, [Val, ...]} | {'$predicate', '=' | '<>' | '>' | '>=' | '<' | '<=' | like, Val} | {'$predicate', 'not', predicate(Val)}
query(Body) = #mekao_query{body = Body}
s() = #mekao_settings{}
select_opt() = {limit, {RowCount::non_neg_integer(), Offset::non_neg_integer()}}
selector() = tuple() | [predicate(term()) | '$skip']
table() = #mekao_table{}
build/1 | |
count/3 | Selects COUNT(*) with WHERE clause based on selector() . |
delete/3 | Deletes entities, composes WHERE clause from Selector
non $skip fields. |
delete_pk/3 | Deletes entity by primary key. |
exists/3 | Selects one column called exists with value 1 or 0 , depends on
EXISTS clause return. |
exists_pk/3 | Same as exists/3 but checks only primary key in EXISTS clause. |
insert/3 | Inserts entity, omits columns with $skip value. |
insert_all/3 | Inserts entities, places DEFAULT keyword when column with $skip
value occurs. |
prepare_count/3 | |
prepare_delete/3 | |
prepare_exists/3 | |
prepare_insert/3 | |
prepare_insert_all/3 | |
prepare_select/3 | |
prepare_select/4 | |
prepare_update/4 | |
select/3 | Selects several entities, omits columns with $skip value. |
select/4 | |
select_pk/3 | Reads entity by it's primary key. |
update/4 | Updates entities, composes WHERE clause from Selector
non $skip fields. |
update_pk/3 | Updates entity by it's primary key, omits columns with $skip value. |
update_pk_diff/4 | Updates only changed fields by primary key. |
count(E::selector(), Table::table(), S::s()) -> {ok, b_query()}
Selects COUNT(*)
with WHERE
clause based on selector()
.
delete(Selector::selector(), Table::table(), S::s()) -> {ok, b_query()}
Deletes entities, composes WHERE clause from Selector
non $skip
fields.
delete_pk(E::selector(), Table::table(), S::s()) -> {ok, b_query()} | {error, pk_miss}
Deletes entity by primary key.
exists(E::selector(), Table::table(), S::s()) -> {ok, b_query()}
Selects one column called exists
with value 1
or 0
, depends on
EXISTS
clause return.
exists_pk(E::selector(), Table::table(), S::s()) -> {ok, b_query()} | {error, pk_miss}
Same as exists/3
but checks only primary key in EXISTS
clause.
Inserts entity, omits columns with $skip
value.
Inserts entities, places DEFAULT
keyword when column with $skip
value occurs.
prepare_count(E::selector(), Table::table(), S::s()) -> p_query()
prepare_delete(E::selector(), Table::table(), S::s()) -> p_query()
prepare_exists(E::selector(), Table::table(), S::s()) -> p_query()
prepare_select(E::selector(), Table::table(), S::s()) -> p_query()
prepare_select(E::selector(), Opts::[select_opt()], Table::table(), S::s()) -> p_query()
prepare_update(SetE::entity(), WhereE::selector(), Table::table(), S::s()) -> p_query()
select(E::selector(), Table::table(), S::s()) -> {ok, b_query()}
Selects several entities, omits columns with $skip
value.
select(E::selector(), Opts::[select_opt()], Table::table(), S::s()) -> {ok, b_query()}
select_pk(E::selector(), Table::table(), S::s()) -> {ok, b_query()} | {error, pk_miss}
Reads entity by it's primary key.
update(E::entity(), Selector::selector(), Table::table(), S::s()) -> {ok, b_query()} | {error, empty_update}
Updates entities, composes WHERE clause from Selector
non $skip
fields. This is possible to update PK as well if it
is not ro = true
.
update_pk(E::selector(), Table::table(), S::s()) -> {ok, b_query()} | {error, pk_miss} | {error, empty_update}
Updates entity by it's primary key, omits columns with $skip
value.
update_pk_diff(Old::entity(), New::entity(), Table::table(), S::s()) -> {ok, b_query()} | {error, pk_miss} | {error, empty_update}
Updates only changed fields by primary key. This is possible to update
PK as well if it is not ro = true
.
Generated by EDoc, Sep 12 2016, 22:00:10.