Function diesel::dsl::count_star[][src]

pub fn count_star() -> CountStar
Expand description

Creates a SQL COUNT(*) expression

For selecting the count of a query, and nothing else, you can just call count on the query instead.

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

Examples

assert_eq!(Ok(2), users.select(count_star()).first(&connection));