Documentation
¶
Index ¶
- type Transaction
- type TxManager
- func (m *TxManager) Commit(ctx context.Context) error
- func (m *TxManager) Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error)
- func (m *TxManager) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
- func (m *TxManager) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
- func (m *TxManager) Rollback(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transaction ¶
type Transaction interface { Commit(ctx context.Context) error Rollback(ctx context.Context) error QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error) Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error) }
Transaction defines the interface for handling transactions.
type TxManager ¶
type TxManager struct {
// contains filtered or unexported fields
}
TxManager provides a concrete implementation of the Transaction interface.
func NewTxManager ¶
func NewTxManager(tx pgx.Tx) *TxManager
NewTxManager creates a new transaction manager from an existing pgx.Tx.
func (*TxManager) Exec ¶
func (m *TxManager) Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error)
Exec executes a query that doesn't return rows and returns a CommandTag.
Click to show internal directories.
Click to hide internal directories.