Relation Query - Get likes in post
Playing around with relational queries and I'm not quite getting how I'd retrieve the count of likes on a given post.
I'm able to accomplish this in sql, but I'm having a hard time translating or failing to understand why i cant translate this to drizzle.
3 Replies
I've completed it like this at the moment, but man, im struggling to turn this into a relational query 😦
currently there is no way to use the SQL
count
inside a relational query, see the warning here https://orm.drizzle.team/docs/rqb#include-custom-fields.
however, you can still achieve what you need with relational queries like this:
there might be some small things that are wrong since it wrote it here in discord, but generally this is how you could do it :)it's true
we will add count soon
just need to decide on proper syntax for it
but I guess someday June it will be in latest