I'm getting a Postgres Error when running my drizzle query but not when running the generated sql
I have a drizzle query.
Which generates this query
When I run my js code I get the error
PostgresError: column "calendar_event.start_time_utc" must appear in the GROUP BY clause or be used in an aggregate function
but when I just run the query in Dbeaver it runs just fine. I'm very confused. I'm not sure if I made a mistake or if this is a bug. Seems like a bug though.1 Reply
Ok so it seems that having the time frame be put in the sql string staffDateExpression is where the problem comes from. It doesn't recognize that they are the same for some reason.
Not sure why
I figured out a way around it. If I use a switch statement and not pass in the
timeFrame
as a parmeter it works. I'm not sure if this problem is a bug in the driver or in drizzle