postgres

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Overview

Package postgres wires the Postgres-backed store implementations into the application via uber-go/fx.

Index

Constants

This section is empty.

Variables

Module provides the Postgres-backed store implementations.

Functions

func NewAccessKeyStore

func NewAccessKeyStore(mdb *MigratedPool) accesskey.Store

func NewBucketStore

func NewBucketStore(mdb *MigratedPool) bucket.Store

func NewDelegationStore

func NewDelegationStore(mdb *MigratedPool) delegation.Store

func NewPostgresPool

func NewPostgresPool(cfg config.PostgresConfig, lc fx.Lifecycle, logger *zap.Logger) (*pgxpool.Pool, error)

NewPostgresPool creates a pgx connection pool and registers a lifecycle hook to ping on start and close it at shutdown.

func NewProviderStore

func NewProviderStore(mdb *MigratedPool) provider.Store

func NewTenantStore

func NewTenantStore(mdb *MigratedPool) tenant.Store

Types

type MigratedPool

type MigratedPool struct {
	*pgxpool.Pool
}

MigratedPool is a *pgxpool.Pool whose schema is guaranteed to be at the head migration revision by the time any store that depends on it is used. Store constructors depend on *MigratedPool rather than *pgxpool.Pool so the fx dependency graph orders NewMigratedPool's migration hook before the stores.

func NewMigratedPool

func NewMigratedPool(lc fx.Lifecycle, cfg config.PostgresConfig, pool *pgxpool.Pool, logger *zap.Logger) *MigratedPool

NewMigratedPool registers an OnStart hook that runs goose migrations against the pool (unless storage.postgres.skip_migrations is true) and returns a *MigratedPool wrapper that store constructors depend on.

Jump to

Keyboard shortcuts

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