pgxtxv5

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

func From(ctx context.Context) (pgx.Tx, bool)

From returns underlying pgx.Tx from the context. If you need to obtain a different interface back see tx.From

func NewDBFromPool

func NewDBFromPool(pool *pgxpool.Pool, opts ...PgxTxOption) tx.DB

NewDBFromPool instantiates new tx.DB *pgxpool.Pool wrapper

Types

type PgxTxOption added in v2.2.0

type PgxTxOption func(pool *Pool)

PgxTxOption represents pgx driver transaction option

func WithTxOptions added in v2.2.0

func WithTxOptions(txOptions pgx.TxOptions) PgxTxOption

WithTxOptions allows us to set transaction options (eg. isolation level)

type Pool

type Pool struct {
	*pgxpool.Pool
	// contains filtered or unexported fields
}

Pool implements tx.DB

func (*Pool) Begin

func (p *Pool) Begin(ctx context.Context) (tx.Transaction, error)

Begin begins pgx transaction

Jump to

Keyboard shortcuts

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