kanidm icon indicating copy to clipboard operation
kanidm copied to clipboard

Backend sorting on queries

Open ToxicMushroom opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe

For the UI it would be nice if lists of entries could be sorted on some attribute so the order stays predictable for users. E.g. coming back to the same web-page with a completely different order of users is not nice imo.

Describe the solution you'd like

As noted by @Firstyear in #3019 we could add sorting functionality to the backend

Describe alternatives you've considered

Sorting the entries after they were returned from the db but this wastes performance by undoing the work that was put into creating the unsorted list, and the db might be able to sort more efficiently because it has indexes.

This alternative is even more infeasible for paginated responses.

Additional context

ToxicMushroom avatar Sep 27 '24 23:09 ToxicMushroom

Sorting options should be a default feature on any interface (REST API, code, cli or web UI) that responds with more than one element. That doesn't mean sort by default but as an option to do so in a stable way.

yaleman avatar Sep 29 '24 06:09 yaleman

Yep, I just wanted the ticket open to track me needing to add it :)

Firstyear avatar Oct 01 '24 00:10 Firstyear

Yeah, just dumping my own thoughts into it to make sure it's called out in detail too 😄

yaleman avatar Oct 01 '24 00:10 yaleman