$returningId is not a function

I am trying to get the ID of the newly inserted record I use mysql according to the document, I try to use $returningId but it doesn't work, my ide gives an error not found
const result = await db
.insert(comments)
.values({
bookId,
chapterId,
userId,
content: escapedContent,
})
.$returningId();
const result = await db
.insert(comments)
.values({
bookId,
chapterId,
userId,
content: escapedContent,
})
.$returningId();
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server