Versions in this module Expand all Collapse all v0 v0.6.0 Oct 9, 2026 Changes in this version + const DistributionPrecision + const MaxExpressionBytes + const MaxExpressionNodes + const MaxRelativeTimeMilliseconds + const SQLiteComputedColumnsDDL + const SQLiteExpressionProfile + const SQLiteMaxBoxSamples + const SQLiteMaxFunctionTextBytes + const SQLiteMaxMedianSamples + const ServerExpressionProfile + func MetricExpression(spec AggSpec) string type AggCompileResult + func CompileSQLiteAggregation(a AggSpec, s Schema) (AggCompileResult, error) type AggSpec + Diagnostics []string + Display *MetricDisplayHint + Distribution *MetricDistribution + Expression string + ExpressionY string + GroupLimit int + Scope string + Sort []MetricSort type CompileResult + OrderArgs []any + WhereArgs []any + func CompileAt(q WireQuery, schema Schema, startIdx int, now time.Time) (CompileResult, int, error) + func CompileSQLite(q WireQuery, s Schema, o SQLiteOptions) (CompileResult, error) + type DefinitionResolver interface + ResolveComputed func(context.Context, string) (ComputedColumn, error) + type DefinitionResolverFunc func(context.Context, string) (ComputedColumn, error) + func (f DefinitionResolverFunc) ResolveComputed(c context.Context, id string) (ComputedColumn, error) + type ExecutionPlan struct + Fingerprint string + Metrics MetricBatchPlan + ResolvedRevisions map[string]string + Rows SQLPlan + func CompileExecution(ctx context.Context, rows WireQuery, metrics MetricQuery, s Schema, ...) (ExecutionPlan, error) + func CompileSQLiteExecution(ctx context.Context, rows WireQuery, metrics MetricQuery, s Schema, ...) (ExecutionPlan, error) type FieldSpec + AggregateOps []string + ExpressionNumeric bool + Groupable *bool + SQLiteDatetimeFormat string + SQLiteSortField string + type MetricBatchPlan struct + Metrics []MetricSQLPlan + RequiresSharedSnapshot bool + func CompileMetrics(ctx context.Context, q MetricQuery, s Schema, o PlanOptions) (MetricBatchPlan, error) + func CompileSQLiteMetrics(ctx context.Context, q MetricQuery, s Schema, o PlanOptions) (MetricBatchPlan, error) + type MetricBoxDistribution struct + Kind string + Summary *MetricBoxSummary + type MetricBoxSummary struct + High float64 + Low float64 + Max float64 + Mean float64 + Median float64 + Method string + Min float64 + N int64 + OutlierCount int64 + Outliers []float64 + Q1 float64 + Q3 float64 + Whiskers string + type MetricDisplayHint struct + Kind string + type MetricDistribution struct + Bins int + Input string + Kind string + Whiskers string + type MetricDistributionResult interface + type MetricHistogramDistribution struct + Counts []int64 + Edges []float64 + Kind string + N int64 + type MetricQuery struct + Diagnostics []any + ExpectedRevisions map[string]string + Limit int + Metrics []AggSpec + Offset int + OrderBy []OrderBy + PlanToken string + Profile string + Snapshot string + Version int + Where []WhereTerm + type MetricSQLPlan struct + ID string + type MetricSort struct + Dir string + Key string + Nulls string + type OutputColumn struct + ErrorAlias string + Field string + Type string + ValueAlias string + type PlanDiagnostic struct + Code string + Field string + Message string + Offset int + func (d *PlanDiagnostic) Error() string + type PlanOptions struct + ComputedGroupable map[string]bool + ExpectedRevisions map[string]string + Identity string + Now time.Time + Resolver DefinitionResolver + SourceArgs []any + SourceSQL string + ValidatePlanToken func(context.Context, string) error + ValidateSnapshot func(context.Context, string) error + type SQLComputedDefinitionResolver struct + Dataset string + Scope string + Tx *sql.Tx + func (r SQLComputedDefinitionResolver) ResolveComputed(ctx context.Context, id string) (ComputedColumn, error) + type SQLPlan struct + Args []any + Columns []OutputColumn + Dependencies []string + Fingerprint string + Profile string + RequiresSnapshot bool + ResolvedRevisions map[string]string + SQL string + Scope string + Stages []SQLStage + func CompileComputedRows(ctx context.Context, q WireQuery, s Schema, o PlanOptions) (SQLPlan, error) + func CompileRowExpression(ctx context.Context, source string, s Schema, o PlanOptions) (SQLPlan, error) + func CompileRowsV2(ctx context.Context, q ServerQueryV2, s Schema, o PlanOptions) (SQLPlan, error) + func CompileSQLiteComputedRows(ctx context.Context, q WireQuery, s Schema, o PlanOptions) (SQLPlan, error) + func CompileSQLiteRowExpression(ctx context.Context, source string, s Schema, o PlanOptions) (SQLPlan, error) + func CompileSQLiteRowsV2(ctx context.Context, q ServerQueryV2, s Schema, o PlanOptions) (SQLPlan, error) + func (p SQLPlan) String() string + type SQLStage struct + Materialized bool + Name string + SQL string + type SQLiteAggregateDescriptor struct + Arity int + Name string + New func() SQLiteAggregateFunction + func SQLiteV2Aggregates() []SQLiteAggregateDescriptor + type SQLiteAggregateFunction interface + Step func([]driver.Value) error + Value func() (driver.Value, error) + type SQLiteAggregationRequest struct + Aggregations []AggSpec + Diagnostics []any + Where []WhereTerm + func (r *SQLiteAggregationRequest) UnmarshalJSON(data []byte) error + type SQLiteAggregationResult struct + Metrics []SQLiteMetric + type SQLiteBucket struct + Count int64 + Keys []any + Value any + type SQLiteComputedColumnStore struct + DB *sql.DB + func (s SQLiteComputedColumnStore) List(ctx context.Context, scope, dataset string) ([]ComputedColumn, error) + func (s SQLiteComputedColumnStore) Save(ctx context.Context, scope, dataset string, request SaveComputedColumnRequest) (ComputedColumn, error) + type SQLiteComputedDefinitionResolver struct + Dataset string + Scope string + Tx *sql.Tx + func (r SQLiteComputedDefinitionResolver) ResolveComputed(ctx context.Context, id string) (ComputedColumn, error) + type SQLiteComputedExecution struct + Fields map[string]SQLiteComputedFieldCapability + Fingerprint string + PlanToken string + Profile string + ResolvedRevisions map[string]string + Snapshot string + type SQLiteComputedFieldCapability struct + Group bool + Measure bool + Select bool + Sort bool + Type string + type SQLiteComputedRow struct + ID any + Values map[string]SQLiteComputedValue + type SQLiteComputedValue struct + Error *SQLiteValueError + Value any + type SQLiteDataset struct + BaseArgs []any + BaseWhereSQL string + FromSQL string + MaxGroups int + MaxLimit int + Schema Schema + func (d SQLiteDataset) Aggregations(ctx context.Context, db *sql.DB, request SQLiteAggregationRequest) (SQLiteAggregationResult, error) + func (d SQLiteDataset) AggregationsIn(ctx context.Context, tx *sql.Tx, request SQLiteAggregationRequest) (SQLiteAggregationResult, error) + func (d SQLiteDataset) Distinct(ctx context.Context, db *sql.DB, field, search string, limit int) (SQLiteDistinctResult, error) + func (d SQLiteDataset) DistinctIn(ctx context.Context, tx *sql.Tx, field, search string, limit int) (SQLiteDistinctResult, error) + func (d SQLiteDataset) FieldStats(ctx context.Context, db *sql.DB, names []string) (map[string]SQLiteFieldStat, error) + func (d SQLiteDataset) FieldStatsIn(ctx context.Context, tx *sql.Tx, names []string) (map[string]SQLiteFieldStat, error) + func (d SQLiteDataset) Rows(ctx context.Context, db *sql.DB, q WireQuery) (SQLiteRowsResult, error) + func (d SQLiteDataset) RowsIn(ctx context.Context, tx *sql.Tx, q WireQuery) (SQLiteRowsResult, error) + type SQLiteDistinctCompile struct + Args []any + ArraySQL string + Expr string + IsNullExpr string + SearchSQL string + func CompileSQLiteDistinct(field, search string, s Schema) (SQLiteDistinctCompile, error) + type SQLiteDistinctResult struct + HasMore bool + HasNull bool + Values []string + type SQLiteFieldStat struct + Distinct int64 + Max any + Min any + type SQLiteMetric struct + Buckets []SQLiteBucket + ID string + type SQLiteMetricCapabilities struct + ComputedFields bool + Distributions bool + Expressions bool + MaxGroups int + Profile string + ShownRows bool + Version int + type SQLiteMetricV2 struct + Buckets []SQLiteMetricV2Bucket + Coverage string + GroupCount int64 + ID string + ProcessedRows int64 + Scope string + type SQLiteMetricV2Bucket struct + Count int64 + Distribution MetricDistributionResult + Error string + InputErrorCount *int64 + Keys []any + NullCount *int64 + Value any + Y *any + YError string + type SQLiteMetricsV2Result struct + Metrics []SQLiteMetricV2 + type SQLiteOptions struct + Now time.Time + type SQLiteRowsResult struct + Rows []map[string]any + Total int64 + type SQLiteRowsV2Result struct + Computed []SQLiteComputedRow + Execution SQLiteComputedExecution + Rows []map[string]any + Total int64 + Version int + type SQLiteScalarFunction struct + Arity int + Call func([]driver.Value) (driver.Value, error) + Name string + func SQLiteFunctions() []SQLiteScalarFunction + func SQLiteV2Functions() []SQLiteScalarFunction + type SQLiteV2Dataset struct + ComputedGroupable map[string]bool + Dataset string + MaxGroups int + MaxPopulation int + MaxRows int + Schema Schema + Scope string + SourceArgs []any + SourceSQL string + func (d SQLiteV2Dataset) Capabilities() SQLiteMetricCapabilities + func (d SQLiteV2Dataset) DescribeComputedIn(ctx context.Context, tx *sql.Tx, ids []string, o PlanOptions) (SQLiteComputedExecution, error) + func (d SQLiteV2Dataset) ExecuteV2(ctx context.Context, db *sql.DB, rows *ServerQueryV2, metrics *MetricQuery, ...) (SQLiteV2ExecutionResult, error) + func (d SQLiteV2Dataset) ExecuteV2In(ctx context.Context, tx *sql.Tx, rows *ServerQueryV2, metrics *MetricQuery, ...) (SQLiteV2ExecutionResult, error) + type SQLiteV2ExecutionResult struct + Metrics *SQLiteMetricsV2Result + Rows *SQLiteRowsV2Result + type SQLiteValueError struct + Code string + type SQLiteWhereResult struct + Args []any + SQL string + func CompileSQLiteWhere(terms []WhereTerm, s Schema, o SQLiteOptions) (SQLiteWhereResult, error) type Schema + func LoadSQLiteSchema(doc []byte) (Schema, error) + type ServerQueryV2 struct + Diagnostics []any + ExpectedRevisions map[string]string + PlanToken string + Profile string + Snapshot string + Version int + func (q *ServerQueryV2) UnmarshalJSON(data []byte) error + type ValueSQL struct + Error string + Type string + Value string type WireQuery + func DecodeSQLiteQuery(data []byte) (WireQuery, error) v0.5.0 Oct 6, 2026 Changes in this version + const ComputedColumnsDDL + const MaxAggregations + const MaxGroupByFields + const MaxOrderByTerms + const MaxQueryLimit + const MaxQueryOffset + const MaxSelectColumns + const MaxWhereClauses + var ErrComputedConflict = errors.New("computed definition changed; reload before saving") + func NewComputedColumnsHandler(repo ComputedColumnRepository, ...) http.Handler + type AggCompileResult struct + GroupBySQL string + SelectExprs []string + func CompileAggregation(spec AggSpec, schema Schema) (AggCompileResult, error) + type AggSpec struct + Field string + GroupBy []string + ID string + Op string + type CompileResult struct + Args []any + OrderSQL string + SelectExprs []string + WhereSQL string + func Compile(q WireQuery, schema Schema, startIdx int) (CompileResult, int, error) + type ComputedColumn struct + Expression ComputedExpression + ID string + Label string + Revision string + type ComputedColumnRepository interface + List func(ctx context.Context, scope, dataset string) ([]ComputedColumn, error) + Save func(ctx context.Context, scope, dataset string, request SaveComputedColumnRequest) (ComputedColumn, error) + type ComputedExpression struct + Language string + Source string + Version int + type DistinctCompile struct + Args []any + Expr string + SearchSQL string + func CompileDistinct(field, search string, schema Schema, startIdx int) (DistinctCompile, int, error) + type DistinctHasNullCompile struct + IsNullExpr string + func CompileDistinctHasNull(field string, schema Schema) (DistinctHasNullCompile, error) + type FieldKind int + const FieldBool + const FieldDatetime + const FieldEnum + const FieldNumber + const FieldText + const FieldTextArray + type FieldSpec struct + ArrayCaseSensitive bool + Expr string + FilterOps []string + Kind FieldKind + Name string + ServerFilter bool + SortExpr string + Sortable bool + Synthetic bool + type OrderBy struct + Dir string + Extract *RegexExtract + Field string + Nulls string + type OrderBys []OrderBy + func (o *OrderBys) UnmarshalJSON(b []byte) error + type RegexExtract struct + Regex string + type SQLComputedColumnStore struct + DB *sql.DB + func (s SQLComputedColumnStore) List(ctx context.Context, scope, dataset string) ([]ComputedColumn, error) + func (s SQLComputedColumnStore) Save(ctx context.Context, scope, dataset string, request SaveComputedColumnRequest) (ComputedColumn, error) + type SaveComputedColumnRequest struct + Column ComputedColumn + ExpectedRevision *string + type Schema struct + DefaultSort []OrderBy + Fields map[string]FieldSpec + IDField string + Name string + TiebreakSort []OrderBy + func LoadSchema(doc []byte) (Schema, error) + type WhereClause struct + Field string + Negated bool + Op string + Value string + type WhereTerm struct + Any []WhereClause + Field string + Negated bool + Op string + Value string + func (t WhereTerm) IsGroup() bool + func (t WhereTerm) Literal() WhereClause + func (t WhereTerm) Predicates() []WhereClause + type WireQuery struct + Aggregations []AggSpec + Limit int + Offset int + OrderBy OrderBys + Select []string + Where []WhereTerm + func DecodeWireQuery(token string) (WireQuery, error) + func (q *WireQuery) UnmarshalJSON(data []byte) error + func (q WireQuery) Validate() error