mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.
GNU Lesser General Public License v2.1
363 stars 93 forks source link

Unexpected symbol 'n' in int\bigint field #271

Closed codecranch closed 5 months ago

codecranch commented 5 months ago

"mariadb": "^3.2.3"

let conn
conn = await pool.getConnection()
const rows = await conn.query("UPDATE users SET enabled = ? WHERE id = ?", [true, 1])

console.log(rows) OkPacket { affectedRows: 1, insertId: 0n, warningStatus: 0 }

insertId: 0n error : Do not know how to serialize a BigInt

Expected 0

rusher commented 5 months ago

There is a specific option insertIdAsNumber to retrieve insertId as number. (see doc)

codecranch commented 5 months ago

insertIdAsNumber: true

OkPacket { affectedRows: 1, insertId: 0, warningStatus: 0 }

Issue close / Thx