Help us shape the future of Go! Take the 2026 Go Developer Survey

pg

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 14

Documentation

Overview

Package pg implements the driver boundary with native pgx codecs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

func NewDriver

func NewDriver(pool *pgxpool.Pool) *Driver

NewDriver leaves version-gated capabilities disabled until explicitly configured.

func Open

func Open(ctx context.Context, dsn string, options ...Option) (*Driver, error)

func (*Driver) BeginTx

func (d *Driver) BeginTx(ctx context.Context, options *dialect.TxOptions) (dialect.Tx, error)

func (*Driver) Capabilities

func (d *Driver) Capabilities() dialect.Capabilities

func (*Driver) Close

func (d *Driver) Close() error

func (*Driver) DB

func (d *Driver) DB() *sql.DB

func (*Driver) Dialect

func (d *Driver) Dialect() dialect.Dialect

func (*Driver) Exec

func (d *Driver) Exec(ctx context.Context, query string, arguments []any) (dialect.Result, error)

func (*Driver) Pool

func (d *Driver) Pool() *pgxpool.Pool

func (*Driver) Query

func (d *Driver) Query(ctx context.Context, query string, arguments []any) (dialect.Rows, error)

func (*Driver) Tx

func (d *Driver) Tx(ctx context.Context) (dialect.Tx, error)

type Option

type Option func(*Driver)

func WithCapabilities

func WithCapabilities(capabilities dialect.Capabilities) Option

type Tx

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

func (*Tx) Commit

func (t *Tx) Commit() error

func (*Tx) Exec

func (t *Tx) Exec(ctx context.Context, query string, arguments []any) (dialect.Result, error)

func (*Tx) Query

func (t *Tx) Query(ctx context.Context, query string, arguments []any) (dialect.Rows, error)

func (*Tx) Rollback

func (t *Tx) Rollback() error

Jump to

Keyboard shortcuts

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