rest-sql 0.3.0

RSQL/FIQL filter parser and validator for REST APIs — parse, validate, compile to native DB queries
Documentation
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
use rest_sql::parsing;
use std::hint::black_box;

const CASES: &[(&str, &str)] = &[
    ("simple", "name==Alice"),
    ("and", "age>18;active==true"),
    ("or", "status==active,status==pending"),
    ("in_list", "role=in=(admin,user,moderator)"),
    ("between", "age=between=(18,65)"),
    ("complex", "(a==1;b>2),c=in=(x,y,z);d=like=foo*"),
    ("fiql", "age=lt=30;score=ge=0.5"),
];

fn bench_parse(c: &mut Criterion) {
    let mut group = c.benchmark_group("parse");
    for (name, input) in CASES {
        group.bench_with_input(BenchmarkId::from_parameter(name), input, |b, i| {
            b.iter(|| parsing::parse(black_box(i)).unwrap())
        });
    }
    group.finish();
}

criterion_group!(benches, bench_parse);
criterion_main!(benches);