Current section

Files

Jump to
cake src cake@query@where.erl
Raw

src/cake@query@where.erl

-module(cake@query@where).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([col/1, bool/1, float/1, int/1, string/1, 'and'/1, 'or'/1, 'not'/1, eq/2, lt/2, lte/2, gt/2, gte/2, in/2, between/3, is_bool/2, is_not_bool/2, is_not/2, is_null/1, is_not_null/1, like/2, ilike/2, similar/2, fragment/1]).
-spec col(binary()) -> cake@internal@query:where_value().
col(Name) ->
_pipe = Name,
{where_column, _pipe}.
-spec bool(boolean()) -> cake@internal@query:where_value().
bool(Value) ->
_pipe = Value,
_pipe@1 = cake@param:bool(_pipe),
{where_param, _pipe@1}.
-spec float(float()) -> cake@internal@query:where_value().
float(Value) ->
_pipe = Value,
_pipe@1 = cake@param:float(_pipe),
{where_param, _pipe@1}.
-spec int(integer()) -> cake@internal@query:where_value().
int(Value) ->
_pipe = Value,
_pipe@1 = cake@param:int(_pipe),
{where_param, _pipe@1}.
-spec string(binary()) -> cake@internal@query:where_value().
string(Value) ->
_pipe = Value,
_pipe@1 = cake@param:string(_pipe),
{where_param, _pipe@1}.
-spec 'and'(list(cake@internal@query:where_part())) -> cake@internal@query:where_part().
'and'(Parts) ->
_pipe = Parts,
{and_where, _pipe}.
-spec 'or'(list(cake@internal@query:where_part())) -> cake@internal@query:where_part().
'or'(Parts) ->
_pipe = Parts,
{or_where, _pipe}.
-spec 'not'(cake@internal@query:where_part()) -> cake@internal@query:where_part().
'not'(Part) ->
_pipe = Part,
{not_where, _pipe}.
-spec eq(cake@internal@query:where_value(), cake@internal@query:where_value()) -> cake@internal@query:where_part().
eq(Val_a, Val_b) ->
_pipe = Val_a,
{where_equal, _pipe, Val_b}.
-spec lt(cake@internal@query:where_value(), cake@internal@query:where_value()) -> cake@internal@query:where_part().
lt(Val_a, Val_b) ->
_pipe = Val_a,
{where_lower, _pipe, Val_b}.
-spec lte(cake@internal@query:where_value(), cake@internal@query:where_value()) -> cake@internal@query:where_part().
lte(Val_a, Val_b) ->
_pipe = Val_a,
{where_lower_or_equal, _pipe, Val_b}.
-spec gt(cake@internal@query:where_value(), cake@internal@query:where_value()) -> cake@internal@query:where_part().
gt(Val_a, Val_b) ->
_pipe = Val_a,
{where_greater, _pipe, Val_b}.
-spec gte(cake@internal@query:where_value(), cake@internal@query:where_value()) -> cake@internal@query:where_part().
gte(Val_a, Val_b) ->
_pipe = Val_a,
{where_greater_or_equal, _pipe, Val_b}.
-spec in(
cake@internal@query:where_value(),
list(cake@internal@query:where_value())
) -> cake@internal@query:where_part().
in(Val, Vals) ->
_pipe = Val,
{where_in, _pipe, Vals}.
-spec between(
cake@internal@query:where_value(),
cake@internal@query:where_value(),
cake@internal@query:where_value()
) -> cake@internal@query:where_part().
between(Val_a, Val_b, Val_c) ->
_pipe = Val_a,
{where_between, _pipe, Val_b, Val_c}.
-spec is_bool(cake@internal@query:where_value(), boolean()) -> cake@internal@query:where_part().
is_bool(Val, B) ->
_pipe = Val,
{where_is_bool, _pipe, B}.
-spec is_not_bool(cake@internal@query:where_value(), boolean()) -> cake@internal@query:where_part().
is_not_bool(Val, B) ->
_pipe = Val,
{where_is_not_bool, _pipe, B}.
-spec is_not(cake@internal@query:where_value(), boolean()) -> cake@internal@query:where_part().
is_not(Val, B) ->
_pipe = Val,
{where_is_not_bool, _pipe, B}.
-spec is_null(cake@internal@query:where_value()) -> cake@internal@query:where_part().
is_null(Val) ->
_pipe = Val,
{where_is_null, _pipe}.
-spec is_not_null(cake@internal@query:where_value()) -> cake@internal@query:where_part().
is_not_null(Val) ->
_pipe = Val,
{where_is_not_null, _pipe}.
-spec like(cake@internal@query:where_value(), binary()) -> cake@internal@query:where_part().
like(Val, Pttrn) ->
_pipe = Val,
{where_like, _pipe, Pttrn}.
-spec ilike(cake@internal@query:where_value(), binary()) -> cake@internal@query:where_part().
ilike(Val, Pttrn) ->
_pipe = Val,
{where_i_like, _pipe, Pttrn}.
-spec similar(cake@internal@query:where_value(), binary()) -> cake@internal@query:where_part().
similar(Val, Pttrn) ->
_pipe = Val,
{where_similar, _pipe, Pttrn}.
-spec fragment(cake@internal@query:fragment()) -> cake@internal@query:where_value().
fragment(Frgmt) ->
_pipe = Frgmt,
{where_fragment, _pipe}.