Hi there. I'd like to ask for help about sorting w...
# orm-help
m
Hi there. I'd like to ask for help about sorting when words have accents. For example, I'd like to sort the following words like this:
Copy code
Ávila
Cáceres
Cantabria
Ceuta
But I get the following:
Copy code
Cantabria
Ceuta
Cáceres
Ávila
I'd like to sort using unicode but I haven't found how to do that. Currently I'm using sqlite as my db provider. Could you point me if there's anything I can set at Prisma or Sqlite level? Thanks in advance!
k
in sqlite, you'd do this by adding
COLLATE UNICODE
after the
ORDER BY
clause.
For example,
...ORDER BY name COLLATE UNICODE;
m
Thanks. Do you suggest adding that in a raw query using Prisma? I haven't found a way to include that in Prisma's orderBy. Something like https://github.com/prisma/prisma/issues/5068
k
there's a chance this could be set on the column during table creation but I'm not sure about it. Could be worth a shot
r
@Miguel A. C. 👋 Have a look at this request and the answer posted 🙂