© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Return object instead of an array when inserting object - Drizzle Team
DT
Drizzle Team
•
2y ago
•
1 reply
Raller
Return object instead of an array when inserting object
How can I get the insert statement to return the inserted object instead of an array
, when I am only inserting one row
?
const insertedRole
= await db
.insert
(role
)
.values
(insertRole
)
.returning
(
)
;
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
Getting an object instead of an array.
DT
Drizzle Team / help
2y ago
How to do "onConflictDoUpdate" when inserting an array of values?
DT
Drizzle Team / help
3y ago
Is it possible to return has many relationship load to return a single object instead of an array.
DT
Drizzle Team / help
2y ago
Array of Objects
DT
Drizzle Team / help
2y ago