Skip to main content

json_get_path_text

Function json_get_path_text 

Source
pub fn json_get_path_text<'a, E>(
    expr: E,
    path: &'a str,
) -> SQLExpr<'a, PostgresValue<'a>, Text, Null, Scalar>
where E: Expr<'a, PostgresValue<'a>>,
Expand description

PostgreSQL #>> operator - get JSON object at specified path as text.

ยงExample

let data = SQL::<PostgresValue>::raw("data");
let nested = json_get_path_text(data, "{a,b}");
assert!(nested.to_sql().sql().contains("#>>"));