#filter #json #data #multiple #resources #serde-json #github

webql

WebQL is a library that allows to get data from multiple resources or JSON and filter the result

1 unstable release

0.1.0 Oct 28, 2022

#165 in #multiple

Apache-2.0

40KB
899 lines

webql

Crates.io CI 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)

All the examples here

Thanks

To all Contributors - you make this happen, thanks!

Copyright

Copyright (c) 2022 @kaplanelad. See LICENSE for further details.

Dependencies

~13–29MB
~448K SLoC