$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();
Was this page helpful?