Versions in this module Expand all Collapse all v0 v0.2.0 Aug 23, 2026 Changes in this version + func Format(input string, opts FormatOptions) (string, error) + func FormatQuery(q *Query, opts FormatOptions) string + func HighlightANSIText(input string) string + func Lint(input string, cfg LintConfig) (*Query, []LintIssue) + func OutputName(item SelectItem) string + func Validate(q *Query, schema Schema) error + type AggregateExpr struct + Field string + Func AggregateFunc + Star bool + type AggregateFunc string + const AggAvg + const AggCount + const AggMax + const AggMin + const AggSum + type Analysis struct + CTEs []Analysis + Fields []FieldRequirement + Functions []AggregateFunc + HasAggregate bool + Joins []JoinRequirement + NestedSources []Analysis + Operation Operation + Sources []ResolvedSource + func Analyze(q *Query, schema Schema) (Analysis, error) + func (a Analysis) Requirements() RequirementSet + type CTE struct + Name string + Query *Query + type CompareExpr struct + Field string + Op CompareOp + Values []Value + type CompareOp string + const OpContains + const OpEq + const OpGT + const OpGTE + const OpIn + const OpIsNull + const OpLT + const OpLTE + const OpNotEq + const OpNotNull + type Entity struct + Fields map[string]Field + Name string + func (e Entity) NormalizeName(fallback string) Entity + func (e Entity) WithName(name string) Entity + type Expr interface + type Field struct + Filterable bool + Name string + Selectable bool + Sortable bool + Type FieldType + type FieldPolicy struct + Aggregatable bool + AggregateFuncs []AggregateFunc + Filterable bool + Groupable bool + Joinable bool + Selectable bool + Sortable bool + type FieldRequirement struct + Aggregate AggregateFunc + Entity string + Field string + OutputName string + Source string + Usage FieldUsage + type FieldType string + const FieldBool + const FieldNumber + const FieldString + const FieldTime + type FieldUsage string + const FieldUsageAggregate + const FieldUsageFilter + const FieldUsageGroup + const FieldUsageHaving + const FieldUsageJoin + const FieldUsageSelect + const FieldUsageSort + type FormatOptions struct + Highlight HighlightStyle + Indent string + Style FormatStyle + func DefaultFormatOptions() FormatOptions + type FormatStyle string + const FormatMultiline + const FormatSingleLine + type HighlightStyle string + const HighlightANSI + const HighlightNone + type Join struct + Alias string + Condition Expr + Entity string + Query *Query + Type JoinType + type JoinRequirement struct + LeftEntity string + RightEntity string + RightSource string + Type JoinType + type JoinType string + const JoinCross + const JoinFull + const JoinInner + const JoinLeft + const JoinRight + type LintConfig struct + AllowedOps []Operation + MaxDepth int + MaxInValues int + MaxNodes int + RequireLimit bool + Schema Schema + type LintIssue struct + Message string + type LogicalExpr struct + Left Expr + Op LogicalOp + Right Expr + type LogicalOp string + const LogicalAnd + const LogicalOr + type NotExpr struct + Expr Expr + type Operation string + const OperationCreate + const OperationDelete + const OperationRead + const OperationUpdate + type Order struct + Desc bool + Field string + type ParseError struct + Message string + Offset int + func (e *ParseError) Error() string + type Policy struct + AllowCTEs bool + AllowNestedSources bool + AllowStar bool + AllowedEntities []string + AllowedFunctions []AggregateFunc + AllowedJoinTypes []JoinType + AllowedOps []Operation + Fields map[string]map[string]FieldPolicy + MaxCTEs int + MaxDepth int + MaxGroupFields int + MaxInValues int + MaxJoins int + MaxLimit int + MaxNodes int + MaxOrderFields int + MaxSelectItems int + MaxSubqueryDepth int + RequireLimit bool + func SafeAnalyticsPolicy(schema Schema) Policy + type PolicyIssue struct + Message string + func CheckAnalysisPolicy(analysis Analysis, policy Policy) []PolicyIssue + func CheckPolicy(q *Query, policy Policy) []PolicyIssue + type Query struct + From string + FromAlias string + FromQuery *Query + GroupBy []string + Having Expr + Joins []Join + Limit int + Operation Operation + OrderBy []Order + Prioritize []string + Select []SelectItem + Where Expr + With []CTE + func Parse(input string) (*Query, error) + type RequirementSet struct + Entities []string + Fields []FieldRequirement + Functions []AggregateFunc + Joins []JoinRequirement + Operations []Operation + type ResolvedSource struct + Alias string + CTE bool + Entity string + JoinType JoinType + Name string + Nested bool + type Row map[string]any + func Eval(q *Query, rows []Row) ([]Row, error) + type Schema struct + Entities map[string]Entity + MaxLimit int + func (s Schema) Normalize() Schema + type SelectItem struct + Aggregate *AggregateExpr + Alias string + Field string + Star bool + type Value struct + Any any + Raw string + Type ValueType + type ValueType string + const ValueBool + const ValueNull + const ValueNumber + const ValueString