pub fn jsonb_exists_all<'a, E>(
expr: E,
keys: &[&'a str],
) -> SQLExpr<'a, PostgresValue<'a>, Boolean, NonNull, E::Aggregate, Arg<E::Nullable, E::Sources>>Expand description
Tests whether all of the keys exist at the top level of a jsonb value (?&).
The operand must be jsonb (JsonbType). The keys are bound as one
text[] parameter. The result is NULL when the operand is NULL.
ยงExamples
use drizzle_postgres::expr::jsonb_exists_all;
use drizzle_core::{ToSQL, expr::raw_non_null};
use drizzle_postgres::values::PostgresValue;
use drizzle_types::postgres::types::Jsonb;
let data = raw_non_null::<PostgresValue, Jsonb>("data");
let cond = jsonb_exists_all(data, &["name", "email"]);
assert_eq!(cond.to_sql().sql(), "data ?& $1");