19 releases (5 breaking)
Uses new Rust 2024
| 0.6.4 | Apr 14, 2026 |
|---|---|
| 0.6.3 | Apr 14, 2026 |
| 0.5.1 | Apr 10, 2026 |
| 0.4.6 | Apr 8, 2026 |
| 0.1.1 | Mar 28, 2026 |
#7 in #data-sync
120KB
3.5K
SLoC
oversync-transforms
Declarative transform step library for the oversync data sync engine.
Part of oversync.
What this crate provides
TransformSteptrait -- interface for a single operation on a record's JSON data, returning keep/dropStepChain-- ordered chain of steps applied sequentially; implementsTransformHookfor use in the sync pipeline- Built-in steps --
Rename,Set,Filter(withEq/Ne/Containsoperators), and more parse_steps-- parse a declarative JSON step definition into aStepChain- Optional WASM support -- enable the
wasmfeature for wasmtime-based transform steps
Usage
use oversync_transforms::{StepChain, steps::{Rename, Filter, FilterOp}};
let chain = StepChain::new(vec![
Box::new(Rename { from: "old_name".into(), to: "new_name".into() }),
Box::new(Filter {
field: "status".into(),
op: FilterOp::Eq,
value: serde_json::json!("active"),
}),
]);
let mut data = serde_json::json!({"old_name": "val", "status": "active"});
let keep = chain.apply_one(&mut data)?;
assert!(keep);
assert_eq!(data["new_name"], "val");
Features
wasm-- enables wasmtime-based WASM transform steps
License
Apache-2.0
Dependencies
~10–19MB
~255K SLoC