Hi, I have a use case where I'm struggling to craf...
# orm-help
m
Hi, I have a use case where I'm struggling to craft a prisma query to count a fact table with multiple dimensions. Here's a contrived example of the schema and queries. Is something like this possible with prisma?
Maybe this should be a groupBy. Something like:
Copy code
prismaClient._comment.groupBy({
        by: ['postid', 'tagid', 'othertagid'],
        _count: true,
        where: {
          user: {
            id: userid,
          }
        }
      })
But I'd like to have the joins in there as well (afaict this isn't possible):
Copy code
prismaClient._comment.groupBy({
        by: ['postid', 'tagid', 'othertagid'],
        _count: true,
        where: {
          user: {
            id: userid,
          }
        },
        include: {post: true, tag: true, othertag: true},
      })