txn_pgx

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PgxExecute

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

Types

type PgxBeginner

type PgxBeginner = *pgxpool.Pool

type PgxDoer added in v0.0.4

type PgxDoer[Stmt any] interface {
	txn.Doer[PgxOptions, PgxBeginner]
	Stmt() Stmt
	SetStmt(Stmt)
}

type PgxDoerBase

type PgxDoerBase[Stmt any] struct {
	txn.DoerBase[PgxOptions, PgxBeginner]
	// contains filtered or unexported fields
}

func (*PgxDoerBase[_]) IsReadOnly

func (do *PgxDoerBase[_]) IsReadOnly() bool

func (*PgxDoerBase[_]) SetReadOnly added in v0.0.5

func (do *PgxDoerBase[_]) SetReadOnly(title string)

func (*PgxDoerBase[_]) SetReadWrite added in v0.0.5

func (do *PgxDoerBase[_]) SetReadWrite(title string)

func (*PgxDoerBase[S]) SetStmt added in v0.0.3

func (do *PgxDoerBase[S]) SetStmt(s S)

func (*PgxDoerBase[S]) Stmt added in v0.0.3

func (do *PgxDoerBase[S]) Stmt() S

type PgxOptions

type PgxOptions = *pgx.TxOptions

type PgxTxn

type PgxTxn struct {
	Raw pgx.Tx
}

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

Jump to

Keyboard shortcuts

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