ksql/
lib.rs

1//! # KSQL
2//!
3//! Is a JSON data expression lexer, parser, cli and library.
4//!
5//! #### Expressions
6//! Expressions support most mathematical and string expressions see the `lexer` module for details of the lexer support and rules.
7//!
8//! ```rust
9//! use ksql::parser::{Parser, Value};
10//! use std::error::Error;
11//!
12//! fn main() -> Result<(), Box<dyn Error>>{
13//!     let src = r#"{"name":"MyCompany", "properties":{"employees": 50}"#.as_bytes();
14//!     let ex = Parser::parse(".properties.employees > 20")?;
15//!     let result = ex.calculate(src)?;
16//!     assert_eq!(Value::Bool(true), result);
17//!     Ok(())
18//! }
19//! ```
20//!
21//!
22
23/// KSQL Expression lexer
24pub mod lexer;
25
26/// KSQL Expression parser
27pub mod parser;