pub struct OrderClause {
pub target: OrderTarget,
pub direction: SortDirection,
pub null_order: NullOrder,
}Fields§
§target: OrderTarget§direction: SortDirection§null_order: NullOrderImplementations§
Source§impl OrderClause
impl OrderClause
pub const fn column(column: &'static str, direction: SortDirection) -> Self
Sourcepub fn relation_scalar(
parent_table: &'static str,
parent_column: &'static str,
related_table: &'static str,
related_column: &'static str,
column: &'static str,
scope: RelatedReadScope,
direction: SortDirection,
) -> Self
pub fn relation_scalar( parent_table: &'static str, parent_column: &'static str, related_table: &'static str, related_column: &'static str, column: &'static str, scope: RelatedReadScope, direction: SortDirection, ) -> Self
Order by related_table.column, one to-one hop away. scope is the
related model’s read scope — <RELATED>_MODEL.related_read_scope(),
or crate::RelatedReadScope::Unscoped only when ordering by rows
the caller may not read is the point.
Sourcepub fn relation_path(
hops: &[RelationHop],
column: &'static str,
direction: SortDirection,
) -> Self
pub fn relation_path( hops: &[RelationHop], column: &'static str, direction: SortDirection, ) -> Self
Order by column at the end of hops (all to-one), each hop
carrying its own read scope.
Panics if hops is empty: a relation sort traverses at least one
relation (generated callers always have).
Sourcepub fn nulls_first(self) -> Self
pub fn nulls_first(self) -> Self
Place NULL values before non-NULL ones for this clause. Use on scheduler / outbox listings where “no scheduled time yet” should sort ahead of every retry-scheduled row.
Sourcepub fn nulls_last(self) -> Self
pub fn nulls_last(self) -> Self
Place NULL values after non-NULL ones (the framework default).
Mostly useful when overriding a programmatically-built clause
that previously asked for nulls_first.