Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case/diacritic insensitive sorting #395

Open
Jeehut opened this issue Oct 18, 2020 · 2 comments
Open

Case/diacritic insensitive sorting #395

Jeehut opened this issue Oct 18, 2020 · 2 comments

Comments

@Jeehut
Copy link

Jeehut commented Oct 18, 2020

First, I'm sorry if I created this in the wrong place (I wasn't sure if to create here on on the Fluent repository). Next, I'd like to note that no issue template is provided on GitHub at the time of this writing, it would probably be helpful to create some.

Now to my issue: I'd like to sort all entries in my Task model using the PostgreSQL driver by the name field. But I'd like to sort it in a case-insensitive manner. I found some discussions about case-insensitive filtering (which also seems to be a still unresolved issue within Fluent), but I've found no mentions of sorting anywhere.

As a first step, I'd be happy if the case-insensitivity was provided at all, even if it is using English as the language. As an improvement it could learn to be language-agnostic, or in the best case even support diacritic-insensitive sorting, too (e.g. ü/Ü/u/u/ú/ù/Ú/Ù would all be equal).

Combining case- and diacritic-insensitive sorting would allow for the typically expected sorting, so I think this is key.

@grennis
Copy link

grennis commented Nov 12, 2020

I was able to do this in my query (postgres):

.sort(.custom("lower(field_name)"))

@0xTim
Copy link
Member

0xTim commented Nov 18, 2020

This is probably out of scope for Fluent since the supported databases don't all support this. Providing a custom query with SQL for the sort function or lowercase function etc is probably the way forward as Fluent needs to be the lowest common denominator of all DBs.

Agree @gwynne ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants