sql-js / sql-js/sql.js

feature-request: support 64bit bigint

未关闭
#341 14 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

enhancement
主要语言
JavaScript
星标
13.7k
派生
1.1k
PR 合并指标
30 天内没有已合并 PR

描述

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
                ]
            ]
        }
    ]
}
 */

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

Start with the db.exec parameter-binding path shown in the issue and the result conversion path for SQLite integers. Compare the requested bigint input and preserveIntegerPrecision output examples with SQLite's integer behavior; done means both cases have agreed semantics and coverage for safe and unsafe integer values.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, sqlite
领域
databases
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。