-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Labels
Automatic EndpointRelated to automatic endpoint creation functionalityRelated to automatic endpoint creation functionalitybugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Describe the bug or question
Pagination in EndpointCreator will produce inconsistent results, as there is no ordering applied together with the offset and limit.
Postgres explanation on why we need order by when doing pagination: https://www.postgresql.org/docs/current/queries-limit.html
To Reproduce
Description
Expecting the arguments "sort_columns" and "sort_orders" of FastCRUD.get_multi to be set, if applying pagination https://github.com/igorbenav/fastcrud/blob/82b6b17ec6bdae0ef6069f7ad7fdaf7518d6714b/fastcrud/endpoint/endpoint_creator.py#L413 Could for example just use the _get_primary_keys function and "desc" as default sort order to achieve this.
Will have a performance impact, as SQL order by is not free lunch.
Metadata
Metadata
Assignees
Labels
Automatic EndpointRelated to automatic endpoint creation functionalityRelated to automatic endpoint creation functionalitybugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request