How to do case-insensitive sort? #2541
-
How can I create the following query using the query builder? select * from shops ORDER BY lower(shops.name) I assume it would end up looking something like this: await db.query.shops.findMany({
orderBy: asc(lower(shops.name)),
}); But no such method ('lower') exists, and I can't spot anything in the docs. Do I need to keep this as a raw query, or is there a way round? Thank you in advance for any pointers. |
Beta Was this translation helpful? Give feedback.
Answered by
Jim-salies
Jul 13, 2024
Replies: 2 comments 2 replies
-
Commenting for reach. Running into a similar situation |
Beta Was this translation helpful? Give feedback.
0 replies
-
asc and desc functions types show that sql function is accepted so this should do the job :
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
sebpowell
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
asc and desc functions types show that sql function is accepted so this should do the job :