pgx

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoTx = errors.New("no transaction in progress")

Functions

This section is empty.

Types

type Driver

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

func New

func New(pool *pgxpool.Pool) *Driver

func (*Driver) Begin

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

func (*Driver) Commit

func (*Driver) Commit(ctx context.Context) error

func (*Driver) Rollback

func (*Driver) Rollback(ctx context.Context) error

func (*Driver) Tx

func (*Driver) Tx(ctx context.Context, def Tx) Tx

type Tx added in v1.1.0

type Tx interface {
	Exec(
		ctx context.Context, sql string, arguments ...any,
	) (commandTag pgconn.CommandTag, err error)
	Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
}

Jump to

Keyboard shortcuts

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