How do I fetch a table with relation table count? #1887
Unanswered
henokyehulu
asked this question in
Q&A
Replies: 1 comment
-
Drizzle ORM does not provide such similar to Prisma solution to retrieve count of rows of a relation table (AFAIK). You can do it using select:
You can find it here, in the very last example |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Lets say I have two tables
I want to fetch a user and number of posts created by this particular user. I know this request can be made very easily in Prisma by using "_count: relation_table". But I can't seem to find a clean way to do this on Drizzle. Please help me guys 🙏🙏🙏
Beta Was this translation helpful? Give feedback.
All reactions