Help us shape the future of Go! Take the 2026 Go Developer Survey

pgdebug

package module
v10.15.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: BSD-2-Clause Imports: 3 Imported by: 2

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