Skip to content

feature-request: support 64bit bigint #341

Open
@kaizhu256

Description

@kaizhu256

not sure how feasible this feature-request is. sqlite3 docs say INTEGERS can be 1, 2, 3, 4, 6, or 8 bytes.

is it possible to:

  1. input - allow 64-bit bigint as a param input? e.g.
db.exec({
    params: {
        "@bigint": 12345678901234567890n
    },
    sql: "SELECT @bigint"
});
  1. output - if integer > Number.MAX_SAFE_INTEGER, then allow option to auto-coerce it to bigint? e.g.
db.exec({
    preserveIntegerPrecision: true,
    sql: "SELECT 1234 AS int, 1234567890123456789 AS bigint"
});
/*
{
    "results": [
        {
            "columns": [
                "int",
                "bigint"
            ],
            "values": [
                [
                    1234,
                    12345678901234567890123456789n
                ]
            ]
        }
    ]
}
 */

Metadata

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