I'm having troubles with MySQL for node, when I see the IDs on the DB, they look fine, but when I grab it with the MySQL (code below) the last 2 digits are replaced by 0, any ideas on what's happening & how to solve it? I also will attach a picture of the database data & settings

dbPool.getConnection((err, con) => {
if (err) throw err
con.query(`SELECT * FROM node_1 WHERE gid`, (err, rows:guildData[]) => {
if(err) throw err
rows.forEach(row => {
client.dataGuilds.set(`${row.gid}`, row)
console.log(row.gid)
})
})
con.release()
})
CodePudding user response:
Solved, instead of turning a bigint into a string, just store it as an string
CodePudding user response:
The problem is that DB bigint exceeds Number.MAX_SAFE_INTEGER. You can use BitInt(x) to convert:
const x = BigInt(928711151708167415);
console.log(x);
