postgres

package
v0.0.0-...-3b1ddad Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package postgres implements the persistence.Provider interface using PostgreSQL as the storage backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider is a persistence.Provider backed by PostgreSQL.

func NewProvider

func NewProvider(u *url.URL) (*Provider, error)

NewProvider returns a Provider configured from a postgres:// or postgresql:// URL. It returns an error if u.Scheme is not "postgres" or "postgresql".

Pool settings can be configured via URL parameters, for example: pool_max_conns, pool_min_conns, pool_max_conn_lifetime, etc.

See pgxpool.ParseConfig for the full list of supported parameters.

func (*Provider) Close

func (p *Provider) Close() error

Close closes the underlying connection pool.

func (*Provider) JournalStore

func (p *Provider) JournalStore(ctx context.Context) (journal.BinaryStore, error)

JournalStore returns a journal store backed by PostgreSQL.

func (*Provider) KVStore

func (p *Provider) KVStore(ctx context.Context) (kv.BinaryStore, error)

KVStore returns a key-value store backed by PostgreSQL.

func (*Provider) SetStore

func (p *Provider) SetStore(ctx context.Context) (set.BinaryStore, error)

SetStore returns a set store backed by PostgreSQL.

Jump to

Keyboard shortcuts

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