zerodds-sql-filter 1.0.0-rc.3.1

OMG DDS 1.4 §B.2.1 ContentFilteredTopic filter-expression parser + evaluator (SQL-92 subset with %N parameters, BETWEEN, LIKE).
Documentation
  • Coverage
  • 100%
    27 out of 27 items documented1 out of 1 items with examples
  • Size
  • Source code size: 38.37 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 649.14 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • zero-objects/zero-dds
    5 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • SandraK82

zerodds-sql-filter

License: Apache-2.0 docs.rs

OMG DDS 1.4 §B.2.1 ContentFilteredTopic filter-expression parser + evaluator for the ZeroDDS stack. Pure-Rust + alloc. Safety classification: SAFE.

Spec-Mapping

Spec Section
OMG DDS 1.4 §B.2.1 (Filter-Expression-Syntax)

Was ist drin

  • parse(input), Expr (And/Or/Not/Cmp/Between), CmpOp, Operand, Value.
  • RowAccess-Trait + Expr::evaluate(row, params).
  • ParseError, EvalError.

Spec coverage (§B.2.1 full)

  • Literale: String/Int/Float/Bool.
  • Identifier: dotted (a.b.c).
  • Parameter %0, %1, …
  • Vergleichs-Ops: =, !=/<>, <, <=, >, >=, LIKE.
  • Boolean: AND, OR, NOT.
  • BETWEEN low AND high + NOT BETWEEN low AND high.
  • Klammern.
  • LIKE-Wildcards: %, _.

Schichten-Position

Layer 4. Pure-Rust + alloc, no ZeroDDS crate deps.

Quickstart

use zerodds_sql_filter::{parse, Value, RowAccess};
use std::collections::HashMap;

struct MapRow(HashMap<String, Value>);
impl RowAccess for MapRow {
    fn get(&self, path: &str) -> Option<Value> { self.0.get(path).cloned() }
}

let expr = parse("color = %0 AND x BETWEEN 0 AND 100").unwrap();
let row = MapRow(HashMap::from([
    ("color".into(), Value::String("RED".into())),
    ("x".into(),     Value::Int(42)),
]));
assert_eq!(expr.evaluate(&row, &[Value::String("RED".into())]), Ok(true));

Stabilitaet

1.0.0-rc.1. Public-API + Filter-Expression-Grammar RC1-stabil.

Tests

cargo test -p zerodds-sql-filter

27 + 1 doc test green.

License

Apache-2.0.