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 ¶
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.
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.
Click to show internal directories.
Click to hide internal directories.