Crate sql_json_path
source ·Expand description
SQL/JSON Path implementation in Rust.
Features
- Compatible with SQL/JSON Path standard and PostgreSQL implementation.
- Independent from JSON implementation. It supports popular libraries like
serde-json
,simd-json
andjsonbb
. Custom JSON types are also supported.
Usage
use serde_json::{json, Value};
use sql_json_path::JsonPath;
let json = json!({"a": 1});
let path = JsonPath::new("$.a").unwrap();
let nodes = path.query(&json).unwrap();
assert_eq!(nodes.len(), 1);
assert_eq!(nodes[0].to_string(), "1");
Modules
- Abstraction over JSON values.
Structs
- A JSON Path value.
- The error type returned when parsing a JSON Path.
Enums
- The error type returned when evaluating a JSON path.