Skip to content

Extremely large/small values #627

Open
@brody4hire

Description

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:

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions