prisma / quaint

SQL Query AST and Visitor for Rust
Apache License 2.0
583 stars 61 forks source link

Fix json negation #321

Closed dpetrick closed 3 years ago

dpetrick commented 3 years ago

Previously, negated single queries, like ConditionTree::not("json".equals(Value::Json(Some(serde_json::Value::Null)))) were rendered incorrectly, like:

(NOT JSON_CONTAINS(`json`, ?) AND JSON_CONTAINS(?, `json`))

The above is incorrect, parens were missing. Fixed it for both the equals and not equals case.