pub struct PkGroup<Table>(/* private fields */);Expand description
Type-level GROUP BY marker: the group key is table Table’s single-column
primary key.
Produced by the proc-macro IntoGroupBy impl when .group_by(col) is
called with a table’s sole primary-key column. Every other column of that
table is functionally dependent on its primary key (SQL:1999), so any
scalar column of Table may appear in SELECT without being listed in
GROUP BY. Columns of other tables (e.g. joined tables) still must be
aggregated.
Beyond correctness, grouping by the bare primary key lets the database
stream groups off the PK order instead of sorting the full result through
a temp structure, which matters for GROUP BY ... ORDER BY pk LIMIT n.
Trait Implementations§
impl<Table: Copy> Copy for PkGroup<Table>
impl<Scope, Cols, T, Proof> MarkerAggValidFor<PkGroup<T>, Proof> for Scoped<SelectCols<Cols>, Scope>where
Cols: ScalarColumnsIn<PkGroup<T>, Proof>,
impl<Scope, T> MarkerAggValidFor<PkGroup<T>> for Scoped<SelectStar, Scope>
impl<Scope, T> MarkerAggValidFor<PkGroup<T>> for Scoped<SelectExpr, Scope>
impl<Scope, R, T> MarkerAggValidFor<PkGroup<T>> for Scoped<SelectAs<R>, Scope>
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