Count in relational queries

How do I count in relational queries? For example if i'm querying db.query.posts.findMany() and want to include an extra field that counts the number of likes (diff table), how can I achieve that? Couldn't make it work with the "extras" and trying to make a sqlcount() there. Thanks in advance
6 Replies
Dan
Dan•2y ago
aggregations are not supported yet, but it's one of our priorities
Will
Will•15mo ago
@bloberenober any news here?
Andrii Sherman
Andrii Sherman•15mo ago
still no updates here, currently you should use separate query to count anything you need Or use drizzle core api to make, where you can simulate almost any query complexity
Ryley
Ryley•7mo ago
Any updates @Andrew Sherman ?
GetPsyched
GetPsyched•7mo ago
Would prefer this done as well
freddie
freddie•7mo ago
and learn some sql along the way! drizzle core API > query builder 🤣
Want results from more Discord servers?
Add your server