/equery

Primary LanguageErlangMIT LicenseMIT

Build Status Coverage Status GitHub tag Hex.pm

equery: erlang postgresql sql generator library


Description

Library for postgresql sql generation.

Simple Example

1> Schema = #{
    fields => #{
        id => #{},
        name => #{}
    },
    table => <<"users">>}.
2> Q = q:from(Schema).
3> Q2 = q:where(fun([#{id := Id}]) -> Id > 3 end, Q).
4> qast:to_sql(qsql:select(Q2)).
{<<"select \"__table-0\".\"id\",\"__table-0\".\"name\" from \"users\" as \"__table-0\" where (\"__table-0\".\"id\" > $1)">>,
 [3]}

More description will be later...