loghooks

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Example
driver := sqlhooks.Wrap(&sqlite3.SQLiteDriver{}, New())
sql.Register("sqlite3-logger", driver)
db, _ := sql.Open("sqlite3-logger", ":memory:")

// This query will output logs
db.Query("SELECT 1+1")
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	// contains filtered or unexported fields
}

func New

func New() *Hook

func (*Hook) After

func (h *Hook) After(ctx context.Context, query string, args ...interface{}) (context.Context, error)

func (*Hook) Before

func (h *Hook) Before(ctx context.Context, query string, args ...interface{}) (context.Context, error)

func (*Hook) OnError

func (h *Hook) OnError(ctx context.Context, err error, query string, args ...interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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