Documentation ¶
Index ¶
- Variables
- func CleanQuery(s string) string
- func MeasureError(id string, err error) error
- func MeasureQuery(logger LazyLogger, slowQueryThresholdMs int64, id string, op string, ...) func() int64
- func MeasureStats(db *sql.DB, id string) error
- func MonitorSQLDriver(db *sql.DB, id string) context.CancelFunc
- type DB
- func (w *DB) Begin() (*Tx, error)
- func (w *DB) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error)
- func (w *DB) Close() error
- func (w *DB) Exec(query string, args ...interface{}) (gosql.Result, error)
- func (w *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (gosql.Result, error)
- func (w *DB) Prepare(query string) (*Stmt, error)
- func (w *DB) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (w *DB) Query(query string, args ...interface{}) (*gosql.Rows, error)
- func (w *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*gosql.Rows, error)
- func (w *DB) QueryRow(query string, args ...interface{}) *gosql.Row
- func (w *DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *gosql.Row
- func (w *DB) SetSlowQueryThreshold(d time.Duration)
- type LazyLogger
- type Stmt
- func (s *Stmt) Close() error
- func (s *Stmt) Exec(args ...any) (gosql.Result, error)
- func (s *Stmt) ExecContext(ctx context.Context, args ...any) (gosql.Result, error)
- func (s *Stmt) Query(args ...any) (*gosql.Rows, error)
- func (s *Stmt) QueryContext(ctx context.Context, args ...any) (*gosql.Rows, error)
- func (s *Stmt) QueryRow(args ...any) *gosql.Row
- func (s *Stmt) QueryRowContext(ctx context.Context, args ...any) *gosql.Row
- type Tx
- func (w *Tx) Commit() error
- func (w *Tx) Context() context.Context
- func (w *Tx) Exec(query string, args ...interface{}) (sql.Result, error)
- func (w *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (w *Tx) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (w *Tx) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (w *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (w *Tx) QueryRow(query string, args ...interface{}) *sql.Row
- func (w *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (w *Tx) Rollback() error
- type TxOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Adding in aliases for the usual error cases ErrNoRows = sql.ErrNoRows ErrConnDone = sql.ErrConnDone ErrTxDone = sql.ErrTxDone )
Functions ¶
func CleanQuery ¶
func MeasureError ¶
func MeasureQuery ¶
func MonitorSQLDriver ¶
func MonitorSQLDriver(db *sql.DB, id string) context.CancelFunc
Types ¶
type DB ¶
func (*DB) ExecContext ¶
func (*DB) PrepareContext ¶
func (*DB) QueryContext ¶
func (*DB) QueryRowContext ¶
func (*DB) SetSlowQueryThreshold ¶
type LazyLogger ¶
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
func (*Stmt) ExecContext ¶
func (*Stmt) QueryContext ¶
type Tx ¶
func (*Tx) ExecContext ¶
func (*Tx) PrepareContext ¶
func (*Tx) QueryContext ¶
func (*Tx) QueryRowContext ¶
Click to show internal directories.
Click to hide internal directories.