How to order by nested/FK property (posts --> author) #2639
-
From the drizzle docs
but what if I want to order on the authors name in case |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I'm not sure you can do this using query. The best approach is probably to build your own query using select.
if you need to aggregate author data, you will probably have to implement aggregate function like json_build_object in postgresql |
Beta Was this translation helpful? Give feedback.
-
these small issues are really frustrating ...i ve build big query functionality for many tables, but now i realized i need to support ordering by these joined relations. So i guess i m going to have to completely rewrite all of it using "almost raw sql". Thats so sad after so deep into project |
Beta Was this translation helpful? Give feedback.
I'm not sure you can do this using query. The best approach is probably to build your own query using select.
if you need to aggregate author data, you will probably have to implement aggregate function like json_build_object in postgresql