Prepared Update statements
Is it possible to use preparad statements for updating data? I was able to use prepared statements with
.select()
, .findFirst()
, or .findMany()
, but I am having trouble with .update()
.
If possible, what would the syntax be? I am trying to update a verificationToken, and I would need two placeholders there. Tried something like this, but It's wrong:
Is this even possible? I am using Drizzle with Postrgres at Neon.6 Replies
I don't think that's possible.
I haven't seen it anywhere.
Prepared statements are indeed available for update: https://github.com/drizzle-team/drizzle-orm/blob/a7dc7e8bbdc3784f67ff32ce39bee3283f080751/drizzle-orm/src/pg-core/query-builders/update.ts#L122
GitHub
drizzle-orm/drizzle-orm/src/pg-core/query-builders/update.ts at a7d...
TypeScript ORM that feels like writing SQL. Contribute to drizzle-team/drizzle-orm development by creating an account on GitHub.
And that's the correct syntax
OH, that's nice.
The placeholders don't seem to be supported tho, or am I doing something wrong?
https://discord.com/channels/1043890932593987624/1202391466865860618
Did you ever manage to resolve this? I am having the same issue.