json_contains

Function json_contains 

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

Create a JSON field contains condition using json_extract

ยงExample

let column = SQL::<SQLiteValue>::raw("metadata");
let condition = json_contains(column, "$.preferences[0]", "dark_theme");
assert_eq!(condition.sql(), "json_extract( metadata , '$.preferences[0]') = ?");