Trait diesel::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().first(&connection);
assert_eq!(Ok(2), count);

Provided Methods

fn count(self) -> Self::Output

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

Implementors