querylogger

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: GPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ext

type Ext interface {
	sqlx.Ext
	sqlx.QueryerContext
	sqlx.ExecerContext
	// QueryRowContext is missing from sqlx.QueryerContext, despite having QueryRowContext
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type QueryLogger

type QueryLogger struct {
	Ext
	Trace bool
}

QueryLogger wraps sql/sqlx methods with loggers.

func (*QueryLogger) Beginx

func (p *QueryLogger) Beginx() (*sqlx.Tx, error)

Beginx .

func (*QueryLogger) Exec

func (p *QueryLogger) Exec(query string, args ...interface{}) (sql.Result, error)

Exec .

func (*QueryLogger) ExecContext

func (p *QueryLogger) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*QueryLogger) Query

func (p *QueryLogger) Query(query string, args ...interface{}) (*sql.Rows, error)

Query .

func (*QueryLogger) QueryContext

func (p *QueryLogger) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*QueryLogger) QueryRow

func (p *QueryLogger) QueryRow(query string, args ...interface{}) *sql.Row

QueryRow .

func (*QueryLogger) QueryRowContext

func (p *QueryLogger) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row

func (*QueryLogger) QueryRowx

func (p *QueryLogger) QueryRowx(query string, args ...interface{}) *sqlx.Row

QueryRowx .

func (*QueryLogger) QueryRowxContext

func (p *QueryLogger) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row

func (*QueryLogger) Queryx

func (p *QueryLogger) Queryx(query string, args ...interface{}) (*sqlx.Rows, error)

Queryx .

func (*QueryLogger) QueryxContext

func (p *QueryLogger) QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error)

Jump to

Keyboard shortcuts

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