Module z_db_pgsql

Postgresql pool worker.

Copyright © 2014-2020 Arjan Scherpenisse

Behaviours: gen_server, poolboy_worker, z_db_worker.

Authors: Arjan Scherpenisse (arjan@scherpenisse.net).

Description

Postgresql pool worker

Data Types

query_result()

query_result() = {ok, Columns::list(), Rows::list()} | {ok, Count::non_neg_integer(), Columns::list(), Rows::list()} | {ok, Count::non_neg_integer()} | {error, term()}

Function Index

code_change/3
ensure_all_started/0
equery/4Query with parameters, the query is interrupted if it takes longer then Timeout msec.
get_raw_connection/1This function MUST NOT be used, but currently is required by the install / upgrade routines.
handle_call/3
handle_cast/2
handle_info/2
init/1
squery/3Simple query without parameters, the query is interrupted if it takes longer then Timeout msec.
start_link/1Threshold above which we do an automatic explain of traced queries.
terminate/2
test_connection/1

Function Details

code_change/3

code_change(OldVsn, State, Extra) -> any()

ensure_all_started/0

ensure_all_started() -> any()

equery/4

equery(Worker::pid(), Sql::string(), Parameters::list(), Timeout::pos_integer()) -> query_result()

Query with parameters, the query is interrupted if it takes longer then Timeout msec.

get_raw_connection/1

get_raw_connection(Context) -> any()

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.

handle_call/3

handle_call(Cmd, From, State) -> any()

handle_cast/2

handle_cast(Msg, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

init/1

init(Args) -> any()

squery/3

squery(Worker::pid(), Sql::string(), Timeout::pos_integer()) -> query_result()

Simple query without parameters, the query is interrupted if it takes longer then Timeout msec.

start_link/1

start_link(Args) -> any()

Threshold above which we do an automatic explain of traced queries.

terminate/2

terminate(Reason, State) -> any()

test_connection/1

test_connection(Args) -> any()


Generated by EDoc