pub enum Type {
Unspecified,
Number,
String,
Bool,
Array(TypeRef),
Record(Record),
Subject,
App {
args: FunArgs,
result: TypeRef,
aggregate: bool,
},
Date,
Time,
DateTime,
Custom(StrRef),
}Expand description
Type information for expressions.
This enum represents the type of expressions in the EventQL type system.
Types can be inferred during semantic analysis or left as Unspecified.
Variants§
Unspecified
Type has not been determined yet
Number
Numeric type (f64)
String
String type
Bool
Boolean type
Array(TypeRef)
Array type
Record(Record)
Record (object) type
Subject
Subject pattern type
App
Function type with support for optional parameters.
The args field uses FunArgs to support both required and optional parameters.
Optional parameters are indicated when args.needed < args.values.len().
Fields
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(StrRef)
Custom type not defined in the EventQL reference
Used when a field is converted to a custom type registered in the analysis options. The string contains the custom type name as it appears in the query.
§Examples
use eventql_parser::Session;
let mut session = Session::builder()
.declare_custom_type("CustomTimestamp")
.build();
let query = session.parse("FROM e IN events PROJECT INTO { ts: e.data.timestamp as CustomTimestamp }").unwrap();
let typed_query = session.run_static_analysis(query).unwrap();