© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
2 replies
Web Dev Cody

A way to use the update function with existing value in row?

How do I do the following SQL

UPDATE counts SET count = count + 1 WHERE id = 1
UPDATE counts SET count = count + 1 WHERE id = 1


but with drizzle orm, such as

await db.update(counts).set({
count: current_count + 1,
});

is that even possible or is raw sql my only option?
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

A way to use the update function with existing value in json blob column?
Drizzle TeamDTDrizzle Team / help
2y ago
Update column A with the value of column B
Drizzle TeamDTDrizzle Team / help
3y ago
Is this the correct way to use With clause (CTEs) to delete a row using only one transaction?
Drizzle TeamDTDrizzle Team / help
2y ago
Best way to use select in a function that is returning a specific type
Drizzle TeamDTDrizzle Team / help
2y ago