Skip to main content

json_gt

Function json_gt 

Source
pub fn json_gt<'a, L, R>(
    left: L,
    path: &'a str,
    value: R,
) -> SQL<'a, SQLiteValue<'a>>
where L: ToSQL<'a, SQLiteValue<'a>>, R: Into<SQLiteValue<'a>>,
Expand description

Create a JSON numeric greater-than condition

ยงExample

let column = SQL::<SQLiteValue>::raw("metadata");
let condition = json_gt(column, "$.score", 85.0);
assert_eq!(condition.sql(), "CAST(json_extract( metadata , '$.score') AS NUMERIC) > ?");