txn_pgx

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PgxExecute

func PgxExecute[D txn.Doer[Txn, PgxBeginner]](
	ctx context.Context, db PgxBeginner, do D, fn txn.DoFunc[Txn, PgxBeginner, D]) (D, error)

Types

type PgxBeginner

type PgxBeginner = *pgxpool.Pool

type PgxDoerBase

type PgxDoerBase struct {
	txn.DoerBase[PgxOptions]
}

func (*PgxDoerBase) IsReadOnly

func (d *PgxDoerBase) IsReadOnly() bool

type PgxOptions

type PgxOptions = *pgx.TxOptions

type PgxTx

type PgxTx = pgx.Tx

type PgxTxn

type PgxTxn struct {
	Raw PgxTx
}

func PgxBeginTxn

func PgxBeginTxn(ctx context.Context, db PgxBeginner, opt PgxOptions) (*PgxTxn, error)

func (*PgxTxn) Commit

func (w *PgxTxn) Commit(ctx context.Context) error

func (*PgxTxn) IsNil

func (w *PgxTxn) IsNil() bool

func (*PgxTxn) Rollback

func (w *PgxTxn) Rollback(ctx context.Context) error

type Txn

type Txn = txn.Txn

Jump to

Keyboard shortcuts

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