P
Prisma5mo ago
d4ltr0n

What are the best practices for using Postgres array functions within a Prisma query?

I want to include cardinality("comments") AS "commentsCount" in my SELECT clause, but I'd prefer not to have to make the entire query raw. Is there some way to get around this? I'm imagining something like the following:
prismaService.posts.findMany({
select: {
primaryText: true,
createdAt: true,
'cardinality("comments") AS "commentsCount"'
}
})
prismaService.posts.findMany({
select: {
primaryText: true,
createdAt: true,
'cardinality("comments") AS "commentsCount"'
}
})
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server