Trait diesel::prelude::CountDsl [] [src]

pub trait CountDsl: SelectDsl<CountStar> + Sized {
    fn count(self) -> Self::Output { ... }
}

Adds a simple count function to queries. Automatically implemented for all types which implement SelectDsl.

Example

let count = users.count().get_result(&connection);
assert_eq!(Ok(2), count);

Provided Methods

Get the count of a query. This is equivalent to .select(count_star())

Implementors