Skip to main content

all

Function all 

Source
pub fn all<'a, V, L>(
    conditions: L,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, L::Nullable, L::Aggregate, L::Sources>
where V: SQLParam + 'a, L: ConditionList<'a, V>,
Expand description

Logical AND of every condition in a tuple.

Renders (a AND b AND c). None elements are skipped, and a list with no present element renders as TRUE. The result is nullable if any element is, and is an aggregate if any element is.

A bare tuple means the same thing where a condition is expected. Use all where a tuple would be read as a list of columns instead (for example as a join’s ON condition), or for lists longer than 8.

§Examples

let cond = all((users.active, gt(users.age, 18)));
assert_eq!(cond.sql(), r#"("users"."active" AND "users"."age" > ?)"#);

let nothing = all((None::<SQLExpr<'_, Value, Int>>,));
assert_eq!(nothing.sql(), "TRUE");