txmanager

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPgxPool

func NewPgxPool(
	conn *pgxpool.Conn,
) *pgxManager

func NewSqlx

func NewSqlx(
	db *sqlx.DB,
) *sqlxManager

Types

type Fn

type Fn func(ctx context.Context) error

type MockTx

type MockTx struct {
	mock.Mock
}

func (*MockTx) Begin

func (m *MockTx) Begin(ctx context.Context) (pgx.Tx, error)

func (*MockTx) Conn

func (m *MockTx) Conn() *pgx.Conn

func (*MockTx) CopyFrom

func (m *MockTx) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)

func (*MockTx) Exec

func (m *MockTx) Exec(ctx context.Context, sql string, arguments ...any) (commandTag pgconn.CommandTag, err error)

func (*MockTx) LargeObjects

func (m *MockTx) LargeObjects() pgx.LargeObjects

func (*MockTx) Prepare

func (m *MockTx) Prepare(ctx context.Context, name, sql string) (*pgconn.StatementDescription, error)

func (*MockTx) Query

func (m *MockTx) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)

func (*MockTx) QueryRow

func (m *MockTx) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row

func (*MockTx) SendBatch

func (m *MockTx) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults

type TxManager

type TxManager interface {
	Do(ctx context.Context, fn Fn) (err error)
	GetTxOrDb(ctx context.Context) trmsqlx.Tr
}

Jump to

Keyboard shortcuts

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