Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/pgo.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@

-export_type([result/0,
error/0,
pool/0,
row/0,
options/0,
pool_config/0,
decode_fun/0]).
decode_fun/0,
decode_option/0]).

-type result() :: #{command := atom(),
num_rows := integer() | table,
rows := list()} | {error, error()} | {error, any()}.
num_rows := non_neg_integer() | table,
rows := [row()]} | {error, error()} | {error, any()}.

-type error() :: {pgo_error, #{error_field() => binary()}} | pg_types:encoding_error().

Expand Down Expand Up @@ -219,16 +223,16 @@ with_conn(Conn, Fun) ->
end.

%% @doc Returns a connection from the pool.
-spec checkout(atom()) -> {ok, pgo_pool:pool_ref(), pgo_pool:conn()} | {error, any()}.
-spec checkout(atom()) -> {ok, pgo_pool:ref(), pgo_pool:conn()} | {error, any()}.
checkout(Pool) ->
pgo_pool:checkout(Pool, []).

-spec checkout(atom(), [pool_option()]) -> {ok, pgo_pool:pool_ref(), pgo_pool:conn()} | {error, any()}.
-spec checkout(atom(), [pool_option()]) -> {ok, pgo_pool:ref(), pgo_pool:conn()} | {error, any()}.
checkout(Pool, Options) ->
pgo_pool:checkout(Pool, Options).

%% @doc Return a checked out connection to its pool
-spec checkin(pgo_pool:pool_ref(), pgo_pool:conn()) -> ok.
-spec checkin(pgo_pool:ref(), pgo_pool:conn()) -> ok.
checkin(Ref, Conn) ->
pgo_pool:checkin(Ref, Conn, []).

Expand Down
Loading