z_db_pgsql (zotonic_core v1.0.0-rc.10)

Postgresql pool worker

Link to this section Summary

Functions

Query with parameters, the query is interrupted if it takes longer than Timeout msec.
This function MUST NOT be used, but currently is required by the install / upgrade routines. Can only be called from inside a z_db:transaction/2.
Simple query without parameters, the query is interrupted if it takes longer than Timeout msec.
Threshold above which we do an automatic explain of traced queries.

Link to this section Types

Link to this type

query_result/0

Link to this section Functions

Link to this function

code_change(OldVsn, State, Extra)

Link to this function

decode_value(V)

Link to this function

ensure_all_started()

Link to this function

equery(Worker, Sql, Parameters, Timeout)

-spec equery(pid(), string() | binary(), list(), pos_integer()) -> query_result().
Query with parameters, the query is interrupted if it takes longer than Timeout msec.
Link to this function

get_raw_connection(Context)

This function MUST NOT be used, but currently is required by the install / upgrade routines. Can only be called from inside a z_db:transaction/2.
Link to this function

handle_call(Cmd, From, State)

Link to this function

handle_cast(Msg, State)

Link to this function

handle_info(Info, State)

Link to this function

is_connection_alive(Worker)

-spec is_connection_alive(pid()) -> boolean().
Link to this function

pool_get_connection(Context)

-spec pool_get_connection(z:context()) -> {ok, pid()} | {error, term()}.
Link to this function

pool_return_connection(Worker, Context)

-spec pool_return_connection(pid(), z:context()) -> ok | {error, term()}.
Link to this function

squery(Worker, Sql, Timeout)

-spec squery(pid(), string() | binary(), pos_integer()) -> query_result().
Simple query without parameters, the query is interrupted if it takes longer than Timeout msec.
Link to this function

start_link(Args)

Threshold above which we do an automatic explain of traced queries.
Link to this function

terminate(Reason, State)

Link to this function

test_connection(Args)

-spec test_connection(list()) -> ok | {error, term()}.