-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Database collation affects result of orderBy (case sensitive) #2369
Comments
Hi, Thanks for reporting this! It has already been reported before, so I am going to close this as a duplicate of prisma/prisma-client-js#343 |
The linked issue does not mention "collation" once, and does not actually describe the problem or the solution in the issue itself @pantharshit00. Are you sure this is an appropriate replacement? If so, it definitely needs an update in description. |
"collation" is irrelevant as client will return the data returned by the database. You will need to change it on db level of you want to have a different behaviour. |
Exactly. prisma/prisma-client-js#343 might offer a workaround when it is implemented, but the underlying problem of @mhwelander is a different one. |
Is it really a problem though? Does client should care about of collation which underlying database uses? We can keep this open but I don't think this is something which is under the scope of Prisma Client |
As it leads to confusing situations to users like @mhwelander I would say the behavior of Prisma here is relevant. |
Changing #343 to 'Add case sensitive/insensitive querying and sorting' as per Jan's suggestion works, just to make sure it is considered in the design (maybe I want filtering to be case-sensitive but ordering to be case-insensitive for the same query, for example). I should have phrased my request differently - the request is that I would like the option to specify case-insensitive ordering just as I can do in regular SQLite (e.g. Sorry about my title! :) |
This issue now tracks feature request for an option to specify |
We did investigate the topic of case sensitivity extensively recently. I will close this issue as it is asking for a specific solution to the problem described in the issue mentioned above. |
Problem
When I order by a
title
field, I get different results if I use PostgreSQL or SQLite because they have different default collation.Default PostgreSQL:
Another one
another one
Bites the
bites the
Dust
dust
Default SQLite:
Another one
Bites the
Dust
another one
bites the
dust
Suggestion
An option to use case-insensitive sorting per instance of client or the ability to specify that I want to sort by title.toLower().
Notes
Have not done any testing on decimals/numbers.
The text was updated successfully, but these errors were encountered: