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();
1 Reply
DiamondDragon
DiamondDragon9mo ago
[insertedRole] destructs item 0

Did you find this page helpful?