Skip to main content

Module sort

Module sort 

Source
Expand description

Shared repository helpers for applying whitelisted sort options.

The helpers accept a caller-provided whitelist of field names and SeaORM columns, then apply ascending or descending ordering to a query. Keeping this logic shared avoids repeating unsafe ad-hoc string-to-column mapping in each repository.

Enums§

SortOrder
Sort direction used by API query parameters.

Functions§

order_by_column
Orders a query by one column.
order_by_column_with_id
Orders a query by one column and then by an id column for stable ordering.
order_by_id
Orders a query by an id column.