pub struct PkGroup<Table>(/* private fields */);Expand description
GROUP BY marker: the group key is Table’s single-column primary key.
The table macros produce this when .group_by(col) is called with a
table’s only primary-key column. Every other column of that table depends
on its primary key (SQL:1999 functional dependency), so any column of
Table may be selected without being listed in GROUP BY. Columns of
other tables (for example joined ones) must still be aggregated.
Grouping by the bare primary key also lets the database read groups in
key order instead of sorting the whole result, which helps
GROUP BY ... ORDER BY pk LIMIT n.
Trait Implementations§
impl<Table: Copy> Copy for PkGroup<Table>
impl<Scope, Used, Cols, T, Proof> MarkerAggValidFor<PkGroup<T>, Proof> for Scoped<SelectCols<Cols>, Scope, Used>where
Cols: ScalarColumnsIn<PkGroup<T>, Proof>,
impl<Scope, Used, T> MarkerAggValidFor<PkGroup<T>> for Scoped<SelectStar, Scope, Used>
impl<Scope, Used, T> MarkerAggValidFor<PkGroup<T>> for Scoped<SelectExpr, Scope, Used>
impl<Scope, Used, R, T> MarkerAggValidFor<PkGroup<T>> for Scoped<SelectAs<R>, Scope, Used>
Auto Trait Implementations§
impl<Table> Freeze for PkGroup<Table>where
PhantomData<Table>: Freeze,
impl<Table> RefUnwindSafe for PkGroup<Table>where
PhantomData<Table>: RefUnwindSafe,
impl<Table> Send for PkGroup<Table>where
PhantomData<Table>: Send,
impl<Table> Sync for PkGroup<Table>where
PhantomData<Table>: Sync,
impl<Table> Unpin for PkGroup<Table>where
PhantomData<Table>: Unpin,
impl<Table> UnsafeUnpin for PkGroup<Table>where
PhantomData<Table>: UnsafeUnpin,
impl<Table> UnwindSafe for PkGroup<Table>where
PhantomData<Table>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more