A complete lexer and parser for EventQL (EQL), a query language designed for event sourcing systems.
- Complete EventQL Support: Parse queries with FROM, WHERE, GROUP BY, ORDER BY, LIMIT, and PROJECT clauses
- Rich Expression Language: Supports arithmetic, comparison, logical operators, and field access
- Detailed Error Reporting: Position-aware error messages with line and column numbers
- Type-Safe AST: Strongly-typed abstract syntax tree for query analysis and execution
- Static Analysis: Provides optional static analysis to catch even more errors before running a query
use eventql_parser::parse_query;
fn main() {
let query = parse_query(
"FROM e IN events WHERE e.id == 1 PROJECT INTO e"
).unwrap();
println!("Parsed query: {:?}", query);
}EventQL supports querying event streams with a SQL-like syntax:
FROM e IN events
WHERE e.price > 100 AND e.category == "electronics"
ORDER BY e.timestamp DESC
LIMIT 10
PROJECT INTO { id: e.id, price: e.price }This parser is based on the EventQL language specification from EventSourcingDB by The Native Web. EventSourcingDB is an event store database that provides a powerful query language (EventQL) for querying and analyzing event streams in event-sourced systems.
MIT