© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago
Cobain

Delete and insert a record using deleted id in one transaction

Hi! I want to delete a record and use the deleted id to insert another one later in the same table. Is it possible to do so in a single transaction? The problem I'm encountering when doing this is I get a primary key error on insertion.
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

How do insert a one-to-one record in an elegant way?
Drizzle TeamDTDrizzle Team / help
3y ago
Auto delete record using timestamp
Drizzle TeamDTDrizzle Team / help
3y ago
Id being required in types when using insert and values
Drizzle TeamDTDrizzle Team / help
2y ago
id on transaction conflict
Drizzle TeamDTDrizzle Team / help
3y ago