Skip to main content

json_ne

Function json_ne 

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

Builds left ->> field != value: the JSON field field does not equal value.

field may be a key name or a JSON path. Like any SQL comparison, this is not true when the field is missing (NULL).

ยงExamples

let column = SQL::<SQLiteValue>::raw("metadata");
let condition = json_ne(column, "theme", "light");
assert_eq!(condition.sql(), "metadata ->> ? != ?");