Behaviours: gen_server, poolboy_worker.
Poolboy worker that holds a single persistent PostgreSQL connection.
Delegates all connection management and result normalisation to
rdbms_pgsql. Connection parameters are taken from the
Args proplist passed by poolboy at startup (which erlang_notifier_sup
derives from the postgres application env key).
{query, SQL, Params} — parameterised query via
rdbms_pgsql:query/3; returns a normalised rdbms_result().{squery, SQL} — simple query (DDL, transaction control).{transaction, Fun} — runs Fun(Conn) inside a
BEGIN/COMMIT block via rdbms_pgsql:transaction/2.terminate/2 closes the connection.
A connection-loss EXIT triggers a worker stop, which poolboy
replaces with a fresh worker — natural reconnect.
abstract datatype: state()
| start_link/1 | Start and link a worker process. |
start_link(Args::proplists:proplist()) -> {ok, pid()} | {error, term()}
Args: Proplist of epgsql connection options.
returns: {ok, Pid} on success, or {error, Reason} on failure
(typically a refused PostgreSQL connection).
Start and link a worker process.
Called by poolboy for each worker slot in the pool.Generated by EDoc