DatabaseError: Duplicate column name 'id'
hey guys, i have a problem in my query but cannot figure out what is causing it.
any idea what's going on?
4 Replies
@philbookst Did you ever figure this out? We're at loss on our end 😅
Try getting the raw sql for the query at issue and printing it out, or use the logger.
https://orm.drizzle.team/docs/goodies#printing-sql-query
https://orm.drizzle.team/docs/goodies#logging
Drizzle ORM - Goodies
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
i'm sorry i don't quite remeber, it was almost a year ago
i do remeber printing out the raw sql and asking chatgpt whats wrong 😄
We figured it out! It was a fundamental misunderstanding on our end with how SQL works with subqueries. To fix it, we did need to reach for some custom sql strings.