eventql-parser 0.1.12

EventQL Lexer and Parser
Documentation
# EventQL Parser

[![Crates.io][crates-badge]][crates-url]
[![Crates.io][crates-download]][crates-url]
[![Build Status][ci-badge]][ci-url]
![Crates.io](https://img.shields.io/crates/l/eventql-parser.svg)

[crates-badge]: https://img.shields.io/crates/v/eventql-parser.svg
[crates-download]: https://img.shields.io/crates/d/eventql-parser.svg
[crates-url]: https://crates.io/crates/eventql-parser
[ci-badge]: https://github.com/YoEight/eventql-parser/workflows/CI/badge.svg
[ci-url]: https://github.com/YoEight/eventql-parser/actions

A complete lexer and parser for EventQL (EQL), a query language designed for event sourcing systems.

## Features

- **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

## Quick Start

```rust
use eventql_parser::Session;

fn main() {
    let mut session = Session::builder().build();
    let query = session.parse(
        "FROM e IN events WHERE e.id == 1 PROJECT INTO e"
    ).unwrap();

    println!("Parsed query: {:?}", query);
}
```

## EventQL Language

EventQL supports querying event streams with a SQL-like syntax:

```sql
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 }
```

## Acknowledgements

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.

[The EventQL Reference]

## License

MIT

[EventSourcingDB]: https://www.thenativeweb.io/products/eventsourcingdb
[The EventQL Reference]: https://docs.eventsourcingdb.io/reference/eventql/