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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected symbol 'n' in int\bigint field

codecranch opened this issue · comments

"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

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

insertIdAsNumber: true

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

Issue close / Thx