pub enum Type {
Unspecified,
Number,
String,
Bool,
Array(Box<Type>),
Record(BTreeMap<String, Type>),
Subject,
App {
args: Vec<Type>,
result: Box<Type>,
},
Date,
Time,
DateTime,
Custom(String),
}Expand description
Type information for expressions.
This enum represents the type of an expression in the E
Variants§
Unspecified
Type has not been determined yet
Number
Numeric type (f64)
String
String type
Bool
Boolean type
Array(Box<Type>)
Array type
Record(BTreeMap<String, Type>)
Record (object) type
Subject
Subject pattern type
App
Function type
Date
Date type (e.g., 2026-01-03)
Used when a field is explicitly converted to a date using the AS DATE syntax.
Time
Time type (e.g., 13:45:39)
Used when a field is explicitly converted to a time using the AS TIME syntax.
DateTime
DateTime type (e.g., 2026-01-01T13:45:39Z)
Used when a field is explicitly converted to a datetime using the AS DATETIME syntax.
Custom(String)
Custom type not defined in the EventQL reference
Used when a field is converted to a custom type registered in AnalysisOptions::custom_types.
The string contains the custom type name as it appears in the query.
§Examples
use eventql_parser::prelude::{parse_query, AnalysisOptions};
let query = parse_query("FROM e IN events PROJECT INTO { ts: e.data.timestamp as CustomTimestamp }").unwrap();
let options = AnalysisOptions::default().add_custom_type("CustomTimestamp");
let typed_query = query.run_static_analysis(&options).unwrap();