Skip to main content

array_overlaps

Function array_overlaps 

Source
pub fn array_overlaps<'a, L, R>(
    left: L,
    right: R,
) -> SQLExpr<'a, PostgresValue<'a>, Bool, NonNull, Scalar>
where L: Expr<'a, PostgresValue<'a>>, R: ToSQL<'a, PostgresValue<'a>>,
Expand description

PostgreSQL && operator - arrays overlap.

Returns true if the arrays have any elements in common.

ยงExample

let tags = SQL::<PostgresValue>::raw("tags");
let condition = array_overlaps(tags, "rust");
assert!(condition.to_sql().sql().contains("&&"));
// Generates: tags && $1