Ayrton Fidelis
03/17/2022, 2:22 PMcreatedAt
date that I think I should group by, but I need it to be grouped by the year-month of this date, ignoring the day/time. With Postgres I think the DATE_TRUNC('month', createdAt)
would be perfect but I'm not allowed to group by that on Prisma. I even tryied to cast it to Prisma.WorkerScalarFieldEnum
but in the runtime it told me this wasn't allowed. Really would appreciate any guidance someone could provide me to achieve that, specially if I don't have to change the database schema for that 😅
Here's what my best attempt looks like:Austin
03/22/2022, 10:28 PM$queryRaw
(https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw) to get this functionality.