common

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBLogger

type DBLogger struct {
	*sqlx.DB
}

DBLogger is a DB wrapper which logs the executed sql queries and their duration.

func (*DBLogger) Beginx

func (db *DBLogger) Beginx() (*TxLogger, error)

Beginx returns a transaction with logging.

func (*DBLogger) Exec

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

Exec logs the queries executed by the Exec method.

func (*DBLogger) Query

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

Query logs the queries executed by the Query method.

func (*DBLogger) QueryRowx

func (db *DBLogger) QueryRowx(query string, args ...interface{}) *sqlx.Row

QueryRowx logs the queries executed by the QueryRowx method.

func (*DBLogger) Queryx

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

Queryx logs the queries executed by the Queryx method.

type TxLogger

type TxLogger struct {
	*sqlx.Tx
}

TxLogger logs the executed sql queries and their duration.

func (*TxLogger) Exec

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

Exec logs the queries executed by the Exec method.

func (*TxLogger) Query

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

Query logs the queries executed by the Query method.

func (*TxLogger) QueryRowx

func (q *TxLogger) QueryRowx(query string, args ...interface{}) *sqlx.Row

QueryRowx logs the queries executed by the QueryRowx method.

func (*TxLogger) Queryx

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

Queryx logs the queries executed by the Queryx method.

Jump to

Keyboard shortcuts

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