Skip to main content

CountQuery

Trait CountQuery 

Source
pub trait CountQuery<Idx> { }
Expand description

SELECT count(*) over a query’s FROM/JOIN/WHERE/GROUP BY, with its ORDER BY/LIMIT/OFFSET dropped — a total counts the rows that match, not the page being shown. Returns a number rather than an Option, since a count query always produces exactly one row.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Output> CountQuery<()> for DynSelect<Postgres, Output>

Erasure is for a query whose joins depend on a condition, and such a query is paged like any other, so it counts like any other. The same goes for a set-operation chain.

Source§

impl<Output> CountQuery<()> for SetOp<Postgres, Output>

Source§

impl<Scope, Sel: Selection<Scope, Idx>, Idx> CountQuery<Idx> for Select<Postgres, Scope, Sel>

Implementors§