Function diesel::dsl::count

source ·
pub fn count<T: SqlType + SingleValue, expr>(
    expr: expr,
) -> count<T, <expr as AsExpression<T>>::Expression>
where expr: AsExpression<T>,
Expand description

Creates a SQL COUNT expression

As with most bare functions, this is not exported by default. You can import it specifically as diesel::dsl::count, or glob import diesel::dsl::*

§Examples

assert_eq!(Ok(1), animals.select(count(name)).first(connection));