Documentation
¶
Index ¶
- func ExtractTxQueryKey(ctx context.Context) (string, bool)
- func InjectTX(ctx context.Context, tx Tx) context.Context
- func ReadCommitted[T any](ctx context.Context, tm TxManager, h GenericHandler[T], opts ...TxOption) (T, error)
- func RepeatableRead[T any](ctx context.Context, tm TxManager, h GenericHandler[T], opts ...TxOption) (T, error)
- func Serializable[T any](ctx context.Context, tm TxManager, h GenericHandler[T], opts ...TxOption) (T, error)
- type GenericHandler
- type Handler
- type Postgres
- type Tx
- type TxConfig
- type TxManager
- type TxOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadCommitted ¶
func RepeatableRead ¶
func Serializable ¶
Types ¶
type Tx ¶
type Tx interface {
Commit(ctx context.Context) error
Rollback(ctx context.Context) error
Conn() *pgx.Conn
CopyFrom(ctx context.Context, table pgx.Identifier, cols []string, src pgx.CopyFromSource) (int64, error)
SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults
LargeObjects() pgx.LargeObjects
Prepare(ctx context.Context, name, sql string) (*pgconn.StatementDescription, error)
Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
Begin(ctx context.Context) (pgx.Tx, error)
}
type TxManager ¶
type TxManager interface {
ReadCommitted(ctx context.Context, h Handler, opts ...TxOption) error
RepeatableRead(ctx context.Context, h Handler, opts ...TxOption) error
Serializable(ctx context.Context, h Handler, opts ...TxOption) error
RunWithOpts(ctx context.Context, h Handler, opts []TxOption) error
}
Click to show internal directories.
Click to hide internal directories.