queryrows

package
v0.0.0-...-0301fe8 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 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

Index

Constants

View Source
const CompletedTraceLimit = 21

CompletedTraceLimit is the deepest ranking CompletedTraceQuery answers exactly; the read cache keeps enough spans per partition for this depth.

View Source
const CompletedTraceQuery = `` /* 352-byte string literal not displayed */

CompletedTraceQuery ranks scoped traces by their best in-window span: an error first, then the longest span, then trace_id and namespace. Arguments are start, end, namespace twice, service twice, and a limit of at most CompletedTraceLimit. Results are namespace, trace_id, and whether the trace has an in-scope, in-window error span.

Variables

This section is empty.

Functions

func ReadWindowColumns

func ReadWindowColumns(ctx context.Context) ([]string, bool)

func RecordCoverage

func RecordCoverage(ctx context.Context, fresh time.Time)

func WithInventoryWindow

func WithInventoryWindow(ctx context.Context, window Window) context.Context

WithInventoryWindow records the logical panel interval before file lookback expansion. It is independent of the raw-file read window and read kind.

func WithReadProfile

func WithReadProfile(ctx context.Context, p *ReadProfile) context.Context

func WithWindow

func WithWindow(ctx context.Context, window Window) context.Context

func WithWindowColumns

func WithWindowColumns(ctx context.Context, columns []string) context.Context

WithWindowColumns records the exact columns a trusted SQL panel bounds with the read window, captured at macro expansion where each column is unambiguous. A raw signal is event-time pruned by the window only when one of these columns is that signal's own event-time clock; a window on any other column (or on another relation joined to it) binds every captured file for the signal instead of silently dropping rows. Absent entirely, every raw signal keeps its default clock-based pruning.

Types

type Coverage

type Coverage struct {
	// contains filtered or unexported fields
}

Coverage carries the oldest incomplete ingest horizon back from snapshot binding to the panel result. Comparisons and auxiliary reads share the value.

func WithCoverage

func WithCoverage(ctx context.Context) (context.Context, *Coverage)

func (*Coverage) FreshTo

func (c *Coverage) FreshTo() time.Time

type Queryer

type Queryer interface {
	QueryContext(ctx context.Context, query string, args ...any) (Rows, error)
}

type ReadKind

type ReadKind uint8

ReadKind identifies private aggregate relations used by trusted dashboard SQL.

const (
	RawRead ReadKind = iota
	TraceCandidateRead
)

type ReadProfile

type ReadProfile struct {
	Wait, Bind, Execute time.Duration
	// Cached batches rank from read_trace_exemplars; tail batches and their
	// spans are read raw, filtered when Pruned.
	CachedBatches, TailBatches, TailSpans int
	Pruned                                bool
}

ReadProfile carries one read's phase times, and for a trace ranking its source's shape, back to the caller's slow-request log. A context holds it for a single QueryContext call.

func ReadProfileFrom

func ReadProfileFrom(ctx context.Context) *ReadProfile

ReadProfileFrom returns the context's profile, or nil.

type ReadTransactioner

type ReadTransactioner interface {
	WithReadTransaction(context.Context, func(Queryer) error) error
}

ReadTransactioner runs related reads on one connection and database snapshot.

type Rows

type Rows interface {
	Close() error
	Columns() ([]string, error)
	Err() error
	Next() bool
	Scan(dest ...any) error
}

Rows is the database row-stream surface used by query consumers. Keeping it as an interface lets storage engines attach resource-lifetime behavior (for example, retaining a Parquet snapshot lock until iteration is complete).

type SQLAdapter

type SQLAdapter struct{ DB SQLQueryer }

func (SQLAdapter) QueryContext

func (a SQLAdapter) QueryContext(ctx context.Context, query string, args ...any) (Rows, error)

func (SQLAdapter) WithReadTransaction

func (a SQLAdapter) WithReadTransaction(ctx context.Context, read func(Queryer) error) error

type SQLQueryer

type SQLQueryer interface {
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
}

SQLQueryer is implemented by *sql.DB and sqlmock's database handle.

type Window

type Window struct {
	Start, End         time.Time
	Namespace, Service string
	Kind               ReadKind
	// RetainedInventory is exact retained-service membership, including uncached
	// files. It ignores event time only for resource_inventory; raw relations
	// still require the caller's explicit event-time predicates.
	RetainedInventory bool
}

Window is an explicit internal read scope. Only callers that apply these event-time predicates may use it to exclude immutable Parquet files.

func ReadInventoryWindow

func ReadInventoryWindow(ctx context.Context) (Window, bool)

func ReadWindow

func ReadWindow(ctx context.Context) (Window, bool)

Jump to

Keyboard shortcuts

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