Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extremely large/small values #627

Open
brodycj opened this issue Jan 30, 2017 · 1 comment
Open

Extremely large/small values #627

brodycj opened this issue Jan 30, 2017 · 1 comment

Comments

@brodycj
Copy link
Contributor

brodycj commented Jan 30, 2017

A client asked about supporting NUMERIC/INTEGER values greater than 2^53 (up to 2^63-1) using https://github.com/peterolson/BigInteger.js. (Note that NUMERIC and INTEGER column affinity are almost the same ref: https://www.sqlite.org/datatype3.html#type_affinity.) The solution for storing the big integer value is to simply use the BigInteger object in the SQL parameters. In JavaScript the BigInteger.toString function would be called automatically and then SQLite would convert the string value to an integer for storage. To retrieve the value as a string to be handled by BigInteger the CAST expression is used as described in the accepted answer to http://stackoverflow.com/questions/12419693/convert-integer-to-text-in-sqlites-select-query. This should work the same way in the case of both Web SQL and this plugin.

For further investigation:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant