sql-js / sql-js/sql.js

Adding the series extension

未关闭
#552 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

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

描述

Hello 👋

I'm trying to add the generate_series function from the series extension to the SQLite build.

At the moment, here is what I have done so far:

  • modify the Makefile so it downloads the series.c file automatically and puts it in the sql-amalgation folder.
  • modify the Makefile so it builds the series.c file and add it to the wasm output.
  • include the _sqlite3_series_init function to the src/exported_functions.json file
  • (this is where it errors) modify the src/api.js file so it calls the sqlite3_series_init function

I read #459 and it seems like we had to do this...?

when running the tests, I'm getting the following error:

  ⚡ RuntimeError: function signature mismatch
        at sqlite3_series_init (<anonymous>:wasm-function[2577]:0x82a1e)
        at Module._sqlite3_series_init (/workspaces/sql.js/dist/sql-wasm.js:6140:105)
        at new Database (/workspaces/sql.js/dist/sql-wasm.js:937:22)
        at Object.exports.test (/workspaces/sql.js/test/test_generate_series.js:4:14)
        at test generate series (/workspaces/sql.js/test/test_generate_series.js:22:17)
        at test (/workspaces/sql.js/node_modules/test/test.js:29:20)
        at next (/workspaces/sql.js/node_modules/test/test.js:69:7)
        at suite (/workspaces/sql.js/node_modules/test/test.js:71:5)
        at Object.run (/workspaces/sql.js/node_modules/test/test.js:87:3)
        at /workspaces/sql.js/test/test_generate_series.js:20:21

Here is my fork with all the modifications I have made: https://github.com/Androz2091/sql.js

Can someone help me to understand? Maybe @twoxfh, and @rhashimoto, who solved the issue #459?

贡献指南

打开贡献指南

从这里开始

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

调研方向

Start with the Makefile, src/exported_functions.json, and src/api.js to trace how series.c is built and initialized. Run test/test_generate_series.js and inspect the reported signature mismatch. Done means the SQLite build initializes the series extension successfully and the generate_series tests pass.

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

评估

技术栈
javascript, sqlite, wasm
领域
api, build-system, database
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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