Yggdrasil for PostgreSQL v5.0.0 Yggdrasil.Postgres.Connection View Source
This module defines a PostgreSQL connection.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Gets connection from a connection
process.
Starts a PostgreSQL connection with a tag
and namespace
for the
configuration. Additionally, it receives GenServer
options
.
Stops a PostgreSQL connection
. Optionally, it receives a stop reason
(defaults to :normal
) and a timeout in milliseconds (defaults to
:infinity
).
Subscribes to the connection given a tag
and namespace
.
Link to this section Types
namespace()
View Source
namespace() :: nil | atom()
namespace() :: nil | atom()
Namespace for the connection.
tag()
View Source
tag() :: :subscriber | :publisher
tag() :: :subscriber | :publisher
Connection types.
Link to this section Functions
child_spec(init_arg) View Source
Returns a specification to start this module under a supervisor.
See Supervisor
.
get(connection)
View Source
get(GenServer.name()) :: {:ok, term()} | {:error, term()}
get(GenServer.name()) :: {:ok, term()} | {:error, term()}
Gets connection from a connection
process.
start_link(config, options \\ [])
View Source
start_link(map(), GenServer.options()) :: GenServer.on_start()
start_link(map(), GenServer.options()) :: GenServer.on_start()
Starts a PostgreSQL connection with a tag
and namespace
for the
configuration. Additionally, it receives GenServer
options
.
stop(connection, reason \\ :normal, timeout \\ :infinity)
View Source
stop(GenServer.name(), term(), :infinity | non_neg_integer()) :: :ok
stop(GenServer.name(), term(), :infinity | non_neg_integer()) :: :ok
Stops a PostgreSQL connection
. Optionally, it receives a stop reason
(defaults to :normal
) and a timeout in milliseconds (defaults to
:infinity
).
subscribe(tag, namespace) View Source
Subscribes to the connection given a tag
and namespace
.