database

package
v0.0.0-...-09b3c4b Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool(ctx context.Context, connString string) (repositories.ConnectionPool, error)

Types

type Pool

type Pool struct {
	*pgxpool.Pool
}

type TransactionManager

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

TransactionManager handles database transactions

func NewTransactionManager

func NewTransactionManager(pool repositories.ConnectionPool) *TransactionManager

func (*TransactionManager) ExecuteInTransaction

func (tm *TransactionManager) ExecuteInTransaction(ctx context.Context, fn func(tx pgx.Tx) error) error

ExecuteInTransaction executes a function within a transaction

func (*TransactionManager) GetTx

func (tm *TransactionManager) GetTx(ctx context.Context) (pgx.Tx, error)

GetTx returns a transaction that can be passed to repositories

Jump to

Keyboard shortcuts

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