transaction

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTx

func GetTx(ctx context.Context) *sql.Tx

func WithTx

func WithTx(ctx context.Context, tx *sql.Tx) context.Context

Types

type Manager

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

func New

func New(db *sql.DB) *Manager

func (*Manager) RunInTx

func (m *Manager) RunInTx(ctx context.Context, fn func(context.Context) error) (err error)

type TxExecutor

type TxExecutor interface {
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}

Jump to

Keyboard shortcuts

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