onConflictDoUpdate excluded with a dynamic column
Hey, I'm trying to perform an insert where it's possible that the record already exists, therefore I'm using
onConflictDoUpdate
, the problem I'm running into is that I can't dynamically set the column to update, here's my current approach:
I'm getting the following error when executing this
2 Replies
Here's the schema
the idea is to be able to dynamically pass either
minMembers
, minMcap
or maxTime
through a parameter to the function, and update that field.Drizzle ORM - Upsert Query
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.