Documentation
¶
Overview ¶
Package stdtxpgxv5 implements the stdtx.Driver for pgx/v5 postgres driver.
Index ¶
- func New(db *pgxpool.Pool, opts ...Option) stdtx.Driver[pgx.Tx]
- type Option
- func AccessMode(v pgx.TxAccessMode) Option
- func BeginWithSQL(v TxBeginSQLFunc) Option
- func DiscourageSeqScan(v bool) Option
- func ExecQueryLoggingLevel(v zapcore.Level) Option
- func IsolationMode(v pgx.TxIsoLevel) Option
- func OnTxCommit(v TxOnCommitFunc) Option
- func TestForMaxQueryPlanCosts(maxCost float64) Option
- type TxBeginSQLFunc
- type TxOnCommitFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(o *options)
Option configures the pgxv5 driver.
func AccessMode ¶
func AccessMode(v pgx.TxAccessMode) Option
AccessMode configure the access mode for transactions created for the driver.
func BeginWithSQL ¶
func BeginWithSQL(v TxBeginSQLFunc) Option
BeginWithSQL configure the access mode for transactions created for the driver.
func DiscourageSeqScan ¶
DiscourageSeqScan configure the access mode for transactions created for the driver.
func ExecQueryLoggingLevel ¶ added in v0.0.122
ExecQueryLoggingLevel configures the level at which transaction's exec and query sql are logged.
func IsolationMode ¶
func IsolationMode(v pgx.TxIsoLevel) Option
IsolationMode configure the access mode for transactions created for the driver.
func OnTxCommit ¶ added in v0.0.149
func OnTxCommit(v TxOnCommitFunc) Option
OnTxCommit configures a hook called right before the transaction is committed.
func TestForMaxQueryPlanCosts ¶ added in v0.0.122
TestForMaxQueryPlanCosts will enable EXPLAIN on every query that is executed with the driver and fail when the cost of the resulting query is above the maximum. Together with the enable_seqscan=OFF it can help test of infefficient queries do to missing indexes.
type TxBeginSQLFunc ¶
TxBeginSQLFunc is the signature for determining custom sql run at the start of the transaction.
type TxOnCommitFunc ¶ added in v0.0.150
TxOnCommitFunc is the signature of a function called on commit.