Skip to main content

count

Function count 

Source
pub fn count<'a, V, E>(
    expr: E,
) -> SQLExpr<'a, V, <V::DialectMarker as CountPolicy>::Count, NonNull, Agg>
where V: SQLParam + 'a, V::DialectMarker: CountPolicy, E: Expr<'a, V>,
Expand description

COUNT(expr) - counts non-null values.

Returns a BigInt, NonNull (count is never NULL), Aggregate expression. Works with any expression type.

ยงExample

use drizzle_core::expr::count;

let count = count(users.email);
// Generates: COUNT("users"."email")