I really don\'t know what is going on here. I have a database table that looks like this:
The maximum integer JavaScript can safely represent is Number.MAX_SAFE_INTEGER, which is 2^53 - 1. Your value is greater than that, which is causing some bits to be lost.
node-mysql has supportBigNumbers
and bigNumberStrings
options that parse BIGINT
s as strings.
var connection = mysql.createConnection({
supportBigNumbers: true,
bigNumberStrings: true
});