esql (esql v0.1.0)

View Source

Summary

Types

command/0

-type command() ::
          {raw, unicode:chardata()} |
          {id, ident()} |
          {list, expr_list()} |
          {predicate, expr_list()} |
          {clause, Start :: sql(), End :: sql(), expr()} |
          {param, term()} |
          {bind, term()} |
          {bind_list, [term()]}.

context/0

-type context() :: map() | list() | tuple() | undefined.

expr/0

-type expr() ::
          ignored() |
          atom() |
          string() |
          unicode:chardata() |
          char() |
          command() |
          shorthand() |
          expr_list().

expr_list/0

-type expr_list() :: [expr()].

ident/0

-type ident() :: [ident_part()].

ident_part/0

-type ident_part() :: atom() | unicode:chardata() | char() | ignored().

ignored/0

-type ignored() :: [] | <<>> | undefined.

option/0

-type option() :: {token, char()} | {convert_fn, esql_build:convert_fn()} | {index, non_neg_integer()}.

options/0

-type options() :: [option()].

params/0

-type params() :: [term()].

shorthand/0

-type shorthand() :: {[term()]} | {term()}.

bind.

sql/0

-type sql() :: unicode:chardata().

Functions

bind(V)

bind_list(L)

clause(Start, Expr)

clause(Start, End, Expr)

format(Fmt, Args)

group_by(L)

having(L)

id(Path)

l(L)

limit(N)

list(L)

offset(N)

order_by(L)

p(Key)

param(Key)

pred(Predicate)

predicate(Pred)

q(L)

-spec q(L :: expr()) -> {sql(), params()}.

q(L, Context)

-spec q(L :: expr(), Context :: context()) -> {sql(), params()}.

q(L, Context, Options)

-spec q(L :: expr(), Context :: context(), Options :: options()) -> {sql(), params()}.

raw(SQL)

returning(L)

set(M)

values(Values)

where(L)