Documentation
¶
Index ¶
- func DebugWithContext(d dialect.Driver, logger func(context.Context, ...any)) dialect.Driver
- type DebugDriver
- func (d *DebugDriver) BeginTx(ctx context.Context, opts *sql.TxOptions) (dialect.Tx, error)
- func (d *DebugDriver) Exec(ctx context.Context, query string, args, v any) error
- func (d *DebugDriver) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (d *DebugDriver) Query(ctx context.Context, query string, args, v any) error
- func (d *DebugDriver) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
- func (d *DebugDriver) Tx(ctx context.Context) (dialect.Tx, error)
- type DebugTx
- func (d *DebugTx) Commit() error
- func (d *DebugTx) Exec(ctx context.Context, query string, args, v any) error
- func (d *DebugTx) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (d *DebugTx) Query(ctx context.Context, query string, args, v any) error
- func (d *DebugTx) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
- func (d *DebugTx) Rollback() error
- type SkipDbLogging
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DebugDriver ¶
type DebugDriver struct {
dialect.Driver // underlying driver.
// contains filtered or unexported fields
}
DebugDriver is a driver that logs all driver operations.
func (*DebugDriver) BeginTx ¶
BeginTx adds an log-id for the transaction and calls the underlying driver BeginTx command if it is supported.
func (*DebugDriver) ExecContext ¶
func (d *DebugDriver) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
ExecContext logs its params and calls the underlying driver ExecContext method if it is supported.
func (*DebugDriver) QueryContext ¶
func (d *DebugDriver) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
QueryContext logs its params and calls the underlying driver QueryContext method if it is supported.
type DebugTx ¶
type DebugTx struct {
dialect.Tx // underlying transaction.
// contains filtered or unexported fields
}
DebugTx is a transaction implementation that logs all transaction operations.
func (*DebugTx) ExecContext ¶
ExecContext logs its params and calls the underlying transaction ExecContext method if it is supported.
func (*DebugTx) QueryContext ¶
QueryContext logs its params and calls the underlying transaction QueryContext method if it is supported.
type SkipDbLogging ¶
type SkipDbLogging struct{}