postgres

package
v0.1.0-alpha.11 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZIT01 = "ZIT01" // custom error code to express missing permissions by the end-user
)

Variables

View Source
var (
	Name = "postgres"
)

Functions

func DecodeConfig

func DecodeConfig(input any) (database.Connector, error)

func NameMatcher

func NameMatcher(name string) bool

Types

type Config

type Config struct {
	*pgxpool.Config
}

func (*Config) Connect

func (c *Config) Connect(ctx context.Context) (database.Pool, error)

Connect implements database.Connector.

type Pool

type Pool struct {
	*pgxpool.Pool
}

func PGxPool

func PGxPool(pool *pgxpool.Pool) *Pool

func (*Pool) Acquire

func (p *Pool) Acquire(ctx context.Context) (database.Connection, error)

Acquire implements database.Pool.

func (*Pool) Begin

Begin implements database.Pool.

func (*Pool) Close

func (p *Pool) Close(_ context.Context) error

Close implements database.Pool.

func (*Pool) Exec

func (p *Pool) Exec(ctx context.Context, sql string, args ...any) (int64, error)

Exec implements database.Pool.

func (*Pool) Migrate

func (p *Pool) Migrate(ctx context.Context) error

Migrate implements database.Migrator.

func (*Pool) MigrateTest

func (p *Pool) MigrateTest(ctx context.Context) error

MigrateTest implements database.PoolTest.

func (*Pool) Ping

func (p *Pool) Ping(ctx context.Context) error

Ping implements database.Pool.

func (*Pool) Query

func (p *Pool) Query(ctx context.Context, sql string, args ...any) (database.Rows, error)

Query implements database.Pool.

func (*Pool) QueryRow

func (p *Pool) QueryRow(ctx context.Context, sql string, args ...any) database.Row

QueryRow implements database.Pool.

func (*Pool) RawDB

func (p *Pool) RawDB() *sql.DB

RawDB implements database.PoolTest.

type PostgresPooler

type PostgresPooler interface {
	// contains filtered or unexported methods
}

type Row

type Row = pgxcommon.Row

Row and Rows are type aliases so that callers that reference postgres.Row / postgres.Rows continue to compile without change.

type Rows

type Rows = pgxcommon.Rows

type Transaction

type Transaction struct {
	*pgxcommon.Transaction
}

func PGxTx

func PGxTx(tx pgx.Tx) *Transaction

PGxTx wraps an existing pgx.Tx in a postgres-dialect transaction.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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