loghooks

package
Version: v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 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 added in v1.1.0

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

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL