buntx

package
v0.0.0-...-b1203ac Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: BSD-3-Clause Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNonTransaction = errors.New("dbtx: underlying type is not a transaction")
	ErrIsTransaction  = errors.New("dbtx: underlying type is transaction")
)
View Source
var ErrContextNotFound = errors.New("buntx: Atomic not found in context")

Functions

func WithValue

func WithValue(ctx context.Context, atm *Atomic) context.Context

Types

type Atomic

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

func MustValue

func MustValue(ctx context.Context) *Atomic

func New

func New(db *bun.DB) *Atomic

func Value

func Value(ctx context.Context) (*Atomic, bool)

func (*Atomic) DB

func (a *Atomic) DB(ctx context.Context) bun.IDB

func (*Atomic) DBTx

func (a *Atomic) DBTx(ctx context.Context) bun.IDB

func (*Atomic) IsTx

func (a *Atomic) IsTx() bool

func (*Atomic) RunInTx

func (a *Atomic) RunInTx(ctx context.Context, fn func(ctx context.Context) error) error

func (*Atomic) Tx

func (a *Atomic) Tx(ctx context.Context) bun.IDB

type DBTX

type DBTX = bun.IDB

DBTX is an alias to bun.IDB.

Jump to

Keyboard shortcuts

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