pub fn static_analysis(
options: &AnalysisOptions,
query: Query<Raw>,
) -> AnalysisResult<Query<Typed>>Expand description
Performs static analysis on an EventQL query.
This function takes a raw (untyped) query and performs type checking and variable scoping analysis. It validates that:
- All variables are properly declared
- Types match expected types in expressions and operations
- Field accesses are valid for their record types
- Function calls have the correct argument types
- Aggregate functions are only used in PROJECT INTO clauses
- Aggregate functions are not mixed with source-bound fields in projections
- Aggregate function arguments are source-bound fields (not constants or function results)
- Record literals are non-empty in projection contexts
§Arguments
options- Configuration containing type information and default scopequery- The raw query to analyze
§Returns
Returns a typed query on success, or an AnalysisError if type checking fails.