© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
How to achieve a returning insert with relations - Drizzle Team
DT
Drizzle Team
•
2y ago
Sam
How to achieve a returning insert with relations
Hey so I noticed this is not currently possible
, any advice on how I might be able to do this with the sql api
?
https://github.com/drizzle-team/drizzle-orm/issues/2325
GitHub
[FEATURE]: Add ability to use relations in `returning()` · Issue #2...
Describe what you want I want to be able to specify with in a returning clause
. For instance
:
/
/ Current code await db
.update
(users
)
.set
(
{ email
}
)
.where
(
.
.
.
)
; const newUser
= await db
.query
.users
.
.
.
.
Drizzle Team
Join
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,959
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
insert returning relations
DT
Drizzle Team / help
3y ago
How to handle relations during insert?
DT
Drizzle Team / help
3y ago
Creating zod insert schema from Query with relations
DT
Drizzle Team / help
3y ago