1 unstable release
0.1.0 | Oct 28, 2022 |
---|
#120 in #multiple
40KB
899 lines
webql
WebQL is a library that allows to get data from multiple resources or JSON and filter the result.
Usage
[dependencies]
webql = { version = "0.1.0" }
Feature flags
github
feature flag for filter pull request data.
Examples
use serde_json::json;
let json = json!({
"url": "https://github.com/rusty-ferris-club/webql",
"body": "some example",
"labels": [
{
"name": "label-1",
},
{
"name": "label-2",
},
],
"user" : {
"login": "kaplanelad"
}
});
let filters = vec![
Filter {
query: r#""user"."login""#.to_string(),
operation: Operation::Equal,
values: vec!["kaplanelad".to_string()],
},
Filter {
query: r#""labels"|={"name"}."name""#.to_string(),
operation: Operation::Equal,
values: vec!["label-1".to_string()],
},
Filter {
query: r#""body""#.to_string(),
operation: Operation::Contains,
values: vec!["example".to_string()],
},
];
jfilter::is_match_filters(&json, &filters)
Thanks
To all Contributors - you make this happen, thanks!
Copyright
Copyright (c) 2022 @kaplanelad. See LICENSE for further details.
Dependencies
~12–27MB
~424K SLoC