mysqljs / mysql

A pure node.js JavaScript Client implementing the MySQL protocol.
MIT License
18.28k stars 2.52k forks source link

Incorrect documentation regarding BIGINT #2432

Closed mgummelt closed 2 years ago

mgummelt commented 3 years ago

The documentation lists BIGINT as one of the types that mysql queries will cast to a javascript string, but I observe them returned as numbers (e.g. -214748364899920200). I have not set the supportBigNumbers or bigNumberStrings configuration variables.

dougwilson commented 2 years ago

You are correct, the docs are incomplete. The default settings will return BIGINT as a Number and error when it cannot be represented in a Number. Turning on the various settings allows it to either sometimes be a string as needed or always be a string.