tx

package
v0.0.0-...-1bb5f61 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBProvider

type DBProvider interface {
	GetDB(ctx context.Context) Querier
}

type Manager

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

func New

func New(pool *pgxpool.Pool) *Manager

func (*Manager) GetDB

func (m *Manager) GetDB(ctx context.Context) Querier

func (*Manager) RunRepeatableRead

func (m *Manager) RunRepeatableRead(ctx context.Context, fn func(ctxTx context.Context) error) error

func (*Manager) RunSerializable

func (m *Manager) RunSerializable(ctx context.Context, fn func(ctxTx context.Context) error) error

func (*Manager) RunTransaction

func (m *Manager) RunTransaction(ctx context.Context, level pgx.TxIsoLevel, fn func(ctxTx context.Context) error) error

type Querier

type Querier interface {
	Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
	Query(ctx context.Context, sql string, optionsAndArgs ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, optionsAndArgs ...interface{}) pgx.Row
}

Jump to

Keyboard shortcuts

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