sqlstatements

package
v0.1.53 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sqlstatements is the sql trace kind: it records the SQL statements commons-db runs on chosen connections, as the SQL statement tap publishes them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kind

Kind is the sql trace kind: statements masked and capped at 64KiB a value.

Types

type Params

type Params struct {
	// Connections name the connections to observe, as profiles reference
	// them, "*" for every connection, or "self" for the server's own
	// database, which "*" does not include.
	Connections []string `json:"connections" clicky:"required,title=Connections"`
	// MinDuration, a duration such as 100ms, records only statements that ran
	// at least that long.
	MinDuration string `json:"minDuration,omitempty" clicky:"title=Minimum duration"`
}

Params choose the statements a capture records.

func (Params) Validate

func (p Params) Validate() error

type StatementRow

type StatementRow struct {
	traces.Truncation
	StartedAt  time.Time `json:"startedAt" pretty:"label=Started" sort:"startedAt"`
	Connection string    `json:"connection" filter:"terms"`
	Driver     string    `json:"driver" filter:"terms"`
	SQL        string    `json:"sql" pretty:"label=SQL" filter:"text"`
	Args       []any     `json:"args,omitempty" pretty:"hide"`
	DurationMs float64   `json:"durationMs" pretty:"label=Duration,type=duration,unit=ms" sort:"durationMs"`
	Rows       int64     `json:"rows" sort:"rows"`
	Error      string    `json:"error,omitempty" filter:"text"`
}

StatementRow is one statement as a capture stores it.

func FromStatement

func FromStatement(statement connection.Statement) StatementRow

FromStatement is the row a capture stores for statement.

Jump to

Keyboard shortcuts

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