$returningId returning extra rows

Not sure if this is intended behaviour but with the mysql2 driver in drizzle-orm this:
console.log(await db.insert(table).values([row1, row2]).$returningId())

Outputs
[
  {
    id: 1,
  }, {
    id: undefined,
  }, {
    id: 2,
  }, {
    id: undefined,
  }
]


When I'd expect it to output
[
  {
    id: 1,
  }, {
    id: 2,
  }
]


Any help is appreciated!
Was this page helpful?