pgdebug

package module
v10.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: BSD-2-Clause Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugHook

type DebugHook struct {
	// Verbose causes hook to print all queries (even those without an error).
	Verbose   bool
	EmptyLine bool
}

DebugHook is a query hook that logs an error with a query if there are any. It can be installed with:

db.AddQueryHook(pgext.DebugHook{})

func NewDebugHook

func NewDebugHook() *DebugHook

func (DebugHook) AfterQuery

func (DebugHook) AfterQuery(context.Context, *pg.QueryEvent) error

func (*DebugHook) BeforeQuery

func (h *DebugHook) BeforeQuery(ctx context.Context, evt *pg.QueryEvent) (context.Context, error)

Jump to

Keyboard shortcuts

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