# `BullMQ.Backends.Postgres.Connection`
[🔗](https://github.com/taskforcesh/bullmq/blob/v2.2.3/lib/bullmq/backends/postgres/connection.ex#L1)

Owns the PostgreSQL connection resources for the BullMQ Postgres backend,
mirroring `BullMQ.RedisConnection`:

  * a `Postgrex` connection pool for regular queries (each pooled connection
    pins its `search_path` to the configured schema, so the portable `.sql`
    files reference unqualified names), and
  * a dedicated `Postgrex.Notifications` process used by the blocking
    "wait for job" / event-stream primitives (`LISTEN`/`NOTIFY`).

Schema migrations are run exactly once at startup on the pool, guarded by a
transaction-scoped advisory lock.

## Options
  * `:name` (required) — name to register the connection under.
  * `:url` — a `postgres://…` connection string, or
  * `:hostname`/`:port`/`:database`/`:username`/`:password` — discrete opts.
  * `:schema` — the namespace for all queues (default `"bullmq"`).
  * `:pool_size` — pool size (default `10`).
  * `:ssl` — SSL options forwarded to `Postgrex`. Accepts `true`, `false`, or a
    keyword list such as `[verify: :verify_none]` or
    `[verify: :verify_peer, cacertfile: "…"]`. When omitted, `sslmode=require`
    in the `:url` enables SSL with `verify: :verify_none`. The `verify-ca` and
    `verify-full` modes require explicit `:ssl` certificate verification options.
  * `:skip_version_check` — bypass the minimum-server-version assertion.
  * `:skip_migrations` — do not run migrations (assume already applied).

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `close`

```elixir
@spec close(atom()) :: :ok
```

Closes the connection pool and notifications.

# `context`

```elixir
@spec context(atom()) :: %{pool: term(), notifications: term(), schema: String.t()}
```

Returns the connection context (`%{pool, notifications, schema}`) for `name`.

# `notifications`

The `Postgrex.Notifications` reference for `name`.

# `pool`

The Postgrex pool reference for `name`.

# `start_link`

```elixir
@spec start_link(keyword()) :: Supervisor.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
