bunzap

package
v0.0.0-...-6ef52c9 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationFieldName     = "operation"
	OperationTimeFieldName = "operation_time_ms"
)

Field names

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryHook

type QueryHook struct {
	bun.QueryHook
	// contains filtered or unexported fields
}

QueryHook defines the structure of our query hook it implements the bun.QueryHook interface

func NewQueryHook

func NewQueryHook(options QueryHookOptions) QueryHook

NewQueryHook returns a new query hook for use with uptrace/bun.

func (QueryHook) AfterQuery

func (qh QueryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)

func (QueryHook) BeforeQuery

func (qh QueryHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context

type QueryHookOptions

type QueryHookOptions struct {
	Logger       *zap.Logger
	SlowDuration time.Duration
}

QueryHookOptions defines the available options for a new query hook.

Jump to

Keyboard shortcuts

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