ksql 0.8.0

A JSON data expression lexer, parser, cli and library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use ksql::parser::{Parser, Value};
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let src = r#"{"name":"MyCompany", "properties":{"employees": 50}"#.as_bytes();
    let ex = Parser::parse(".properties.employees > 20")?;
    let result = ex.calculate(src)?;
    println!("{}", &result);
    assert_eq!(Value::Bool(true), result);

    Ok(())
}