dbtrace

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Record

func Record(sql string, rows int64, duration time.Duration, err error)

Record saves a statement in a small process-local ring buffer for nearby diagnostic logs such as dqlite protocol warnings.

func Reset

func Reset()

Reset clears the trace buffer. It is intended for tests.

Types

type Statement

type Statement struct {
	At       time.Time `json:"at"`
	Duration string    `json:"duration"`
	Rows     int64     `json:"rows"`
	SQL      string    `json:"sql"`
	Error    string    `json:"error,omitempty"`
}

Statement describes a recently executed database statement. SQL is the rendered statement emitted by GORM, including bound values where GORM can render them for logging.

func Recent

func Recent(limit int) []Statement

Recent returns up to limit recent statements ordered oldest to newest.

Jump to

Keyboard shortcuts

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