Help us shape the future of Go! Take the 2026 Go Developer Survey

dashboardquery

package module
v0.0.0-...-d808643 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package dashboardquery evaluates Dashboard Language for local SQLite consumers. Hosted PostgreSQL execution remains independently SQL-backed.

Index

Constants

View Source
const DatabaseName = "gh-aw-cao-dashboard-data"
View Source
const DatabaseVersion = 43

Variables

This section is empty.

Functions

func CompareRecordKeys

func CompareRecordKeys(left, right any) int

func Execute

func Execute(ctx context.Context, definition map[string]any, load func(string) ([]map[string]any, error)) ([]map[string]any, error)

Execute evaluates one declarative definition with bounded, cancelable work. The loader owns source authorization and dependency resolution.

func OperationalValueEvidenceMetadata

func OperationalValueEvidenceMetadata(packets []map[string]any) (map[string]any, error)

OperationalValueEvidenceMetadata preserves evidence clocks without promoting incomplete acquisition or old captures to complete/fresh observations.

func OperationalValueEvidenceRows

func OperationalValueEvidenceRows(packets []map[string]any) ([]map[string]any, error)

OperationalValueEvidenceRows only projects acquired facts. Report computation belongs to the declarative query plan, never the storage adapter.

func ParseDate

func ParseDate(value any) (float64, bool)

ParseDate parses the date vocabulary used by Dashboard Language.

func ReadCollection

func ReadCollection(ctx context.Context, db SnapshotReader, collection string, maxRows int, maxBytes int64) (result []map[string]any, err error)

ReadCollection preserves canonical IndexedDB key order and omits storage-only fields. Positive limits bound allocation before materializing a collection.

func ReadCollectionFields

func ReadCollectionFields(ctx context.Context, db SnapshotReader, collection string, fields []string, maxRows int, maxBytes int64) (result []map[string]any, err error)

ReadCollectionFields projects known-live fields inside SQLite. A nil field list preserves every public field, and limits still cover full stored records.

func String

func String(value any) string

String preserves Dashboard Language's JavaScript-compatible scalar spelling.

func ValidRecordKey

func ValidRecordKey(key any) bool

Types

type Evaluator

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

Evaluator shares one deadline and operation budget across a dependency DAG. Intermediate results may reach the input-row budget; callers bound wire pages.

func NewEvaluator

func NewEvaluator(ctx context.Context) *Evaluator

func NewEvaluatorWithLimits

func NewEvaluatorWithLimits(ctx context.Context, inputRows int, operations int64) (*Evaluator, error)

NewEvaluatorWithLimits admits larger local snapshots without changing the default CLI limits or the caller's independent wire and memory budgets.

func (*Evaluator) Execute

func (e *Evaluator) Execute(definition map[string]any, load func(string) ([]map[string]any, error)) ([]map[string]any, error)

func (*Evaluator) Operations

func (e *Evaluator) Operations() int64

type NativeQueryCancelledError

type NativeQueryCancelledError struct {
	Kind  string
	Cause error
}

func (*NativeQueryCancelledError) Error

func (e *NativeQueryCancelledError) Error() string

func (*NativeQueryCancelledError) Unwrap

func (e *NativeQueryCancelledError) Unwrap() error

type NativeQueryUnavailableError

type NativeQueryUnavailableError struct {
	Source string
	Reason string
	Cause  error
}

NativeQueryUnavailableError distinguishes unavailable evidence or an invalid declarative plan from a successful query over an empty collection.

func (*NativeQueryUnavailableError) Error

func (*NativeQueryUnavailableError) Unwrap

func (e *NativeQueryUnavailableError) Unwrap() error

type SnapshotReader

type SnapshotReader interface {
	QueryContext(context.Context, string, ...any) (*sql.Rows, error)
}

SnapshotReader accepts a database or an already pinned read transaction.

Jump to

Keyboard shortcuts

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