Yggdrasil for PostgreSQL v5.0.1 Yggdrasil.Postgres.Connection View Source

This module defines a PostgreSQL connection.

Link to this section Summary

Types

Namespace for the connection.

Connection types.

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

Link to this type

namespace()

View Source
namespace() :: nil | atom()

Namespace for the connection.

Link to this type

tag()

View Source
tag() :: :subscriber | :publisher

Connection types.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

get(connection)

View Source
get(GenServer.name()) :: {:ok, term()} | {:error, term()}

Gets connection from a connection process.

Link to this function

start_link(config, options \\ [])

View Source
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.

Link to this function

stop(connection, reason \\ :normal, timeout \\ :infinity)

View Source
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).

Link to this function

subscribe(tag, namespace)

View Source
subscribe(tag(), namespace()) :: :ok

Subscribes to the connection given a tag and namespace.