Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PgxExecute ¶
func PgxExecute[D txn.Doer[PgxOptions, PgxBeginner]]( ctx context.Context, db PgxBeginner, do D, fn txn.DoFunc[PgxOptions, PgxBeginner, D]) (D, error)
PgxExecute executes a pgx transaction.
Types ¶
type PgxDoer ¶ added in v0.0.4
type PgxDoer[Stmt any] interface { txn.Doer[PgxOptions, PgxBeginner] Stmt() Stmt SetStmt(Stmt) }
PgxDoer defines the interface for PGX transaction operations.
type PgxDoerBase ¶
type PgxDoerBase[Stmt any] struct { txn.DoerBase[PgxOptions, PgxBeginner] // contains filtered or unexported fields }
PgxDoerBase provides a base implementation for the PgxDoer interface.
func (*PgxDoerBase[_]) IsReadOnly ¶
func (do *PgxDoerBase[_]) IsReadOnly() bool
IsReadOnly checks if the transaction is read-only.
func (*PgxDoerBase[_]) SetReadOnly ¶ added in v0.0.5
func (do *PgxDoerBase[_]) SetReadOnly(title string)
SetReadOnly sets the transaction to read-only mode.
func (*PgxDoerBase[_]) SetReadWrite ¶ added in v0.0.5
func (do *PgxDoerBase[_]) SetReadWrite(title string)
SetReadWrite sets the transaction to read-write mode.
func (*PgxDoerBase[S]) SetStmt ¶ added in v0.0.3
func (do *PgxDoerBase[S]) SetStmt(s S)
SetStmt sets the statement.
func (*PgxDoerBase[S]) Stmt ¶ added in v0.0.3
func (do *PgxDoerBase[S]) Stmt() S
Stmt returns the statement.
type PgxTxn ¶
type PgxTxn struct {
Raw pgx.Tx
}
PgxTxn wraps a raw pgx.Tx transaction.
func PgxBeginTxn ¶
func PgxBeginTxn(ctx context.Context, db PgxBeginner, opt PgxOptions) (*PgxTxn, error)
PgxBeginTxn begins a pgx transaction.
Click to show internal directories.
Click to hide internal directories.