Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 786 Bytes

README.md

File metadata and controls

24 lines (15 loc) · 786 Bytes

epgsqerl

An Erlang PostgreSQL client, a mash-up of epgsql, poolboy and sqerl. It uses pgapp to combine epgsql and poolboy.

Build

$ ./rebar3 compile

Try in shell

$ ./rebar3 shell

Make sure you have set up shell.config properly first.

Examples:

% Using sqerl DSL:
> epgsqerl:squery(pool1, {select, 1}).
> epgsqerl:squery(pool1, {select, foo, {from, bar}, {where, {id,'=',1}}}).
> epgsqerl:equery(pool1, {select, foo, {from, bar}, {where, "id=$1"}}, [1]).

% Using raw SQL:
> epgsqerl:squery(pool1, <<"SELECT 1">>).
> epgsqerl:equery(pool1, <<"SELECT foo FROM bar WHERE id=$1">>, [1]).