postgres

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package postgres provides the PostgreSQL storage adapter for Auth-All.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(db *sql.DB) store.Store

New returns a PostgreSQL store over an application-owned database handle.

func NewPool added in v0.3.0

func NewPool(pool *pgxpool.Pool, opts ...Option) (store.Store, error)

NewPool returns a PostgreSQL store over an application-owned pgx pool.

The store is safe behind a transaction pooler. It makes no named prepared statement, takes no advisory lock, and creates no temporary table. The pool must therefore use an exec mode that caches no statement. NewPool refuses another mode, because the failure would otherwise appear later as a random "prepared statement does not exist" error.

func Open

func Open(dsn string) (*sql.DB, error)

Open returns a database handle for a PostgreSQL DSN. The application owns the returned handle.

Types

type Option added in v0.3.0

type Option func(*poolConfig)

Option configures the pool store.

func AllowStatementCache added in v0.3.0

func AllowStatementCache() Option

AllowStatementCache accepts a pool whose exec mode caches a prepared statement. Use it only when no transaction pooler stands between the application and PostgreSQL.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL