Function diesel::expression::dsl::count_star
[−]
[src]
pub fn count_star() -> CountStar
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::expression::count_star
, or glob import
diesel::expression::dsl::*
Example
assert_eq!(Ok(2), users.select(count_star()).first(&connection));