debug

package
v4.0.0-...-54dc81d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugWithContext

func DebugWithContext(d dialect.Driver, logger func(context.Context, ...any)) dialect.Driver

DebugWithContext gets a driver and a logging function, and returns a new debugged-driver that prints all outgoing operations with context.

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

func (d *DebugDriver) BeginTx(ctx context.Context, opts *sql.TxOptions) (dialect.Tx, error)

BeginTx adds an log-id for the transaction and calls the underlying driver BeginTx command if it is supported.

func (*DebugDriver) Exec

func (d *DebugDriver) Exec(ctx context.Context, query string, args, v any) error

Exec logs its params and calls the underlying driver Exec method.

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) Query

func (d *DebugDriver) Query(ctx context.Context, query string, args, v any) error

Query logs its params and calls the underlying driver Query method.

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.

func (*DebugDriver) Tx

func (d *DebugDriver) Tx(ctx context.Context) (dialect.Tx, error)

Tx adds an log-id for the transaction and calls the underlying driver Tx command.

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) Commit

func (d *DebugTx) Commit() error

Commit logs this step and calls the underlying transaction Commit method.

func (*DebugTx) Exec

func (d *DebugTx) Exec(ctx context.Context, query string, args, v any) error

Exec logs its params and calls the underlying transaction Exec method.

func (*DebugTx) ExecContext

func (d *DebugTx) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)

ExecContext logs its params and calls the underlying transaction ExecContext method if it is supported.

func (*DebugTx) Query

func (d *DebugTx) Query(ctx context.Context, query string, args, v any) error

Query logs its params and calls the underlying transaction Query method.

func (*DebugTx) QueryContext

func (d *DebugTx) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)

QueryContext logs its params and calls the underlying transaction QueryContext method if it is supported.

func (*DebugTx) Rollback

func (d *DebugTx) Rollback() error

Rollback logs this step and calls the underlying transaction Rollback method.

type SkipDbLogging

type SkipDbLogging struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL