Skip to content

sqlite: enable common flags - #57621

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
geeksilva97:enable-common-sqlite-flags
Apr 4, 2025
Merged

nodejs-github-bot merged 2 commits into
nodejs:mainfrom
geeksilva97:enable-common-sqlite-flags

Conversation

@geeksilva97

@geeksilva97 geeksilva97 commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

This PR enables flags that are common to other sqlite players in Node.js ecosystem:

This is related to #56476, even though it does not enable the RBU extension.

I see this as a good step toward the stabilization since it will make it easier for people from other dependencies.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg
  • @nodejs/sqlite

@nodejs-github-bot nodejs-github-bot added dependencies PRs that add, update, or configure Node.js dependencies. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Mar 25, 2025
@geeksilva97

Copy link
Copy Markdown
Contributor Author

Not sure whether this will be a problem, but this increases the binary size by 600KB.

@geeksilva97
geeksilva97 force-pushed the enable-common-sqlite-flags branch from e4b93b9 to 9590dee Compare March 25, 2025 17:53

@cjihrig cjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not saying whether or not we should land this, but https://github.com/nodejs/node/blob/main/deps/sqlite/unofficial.gni should be updated, and there should be at least one test for each new API to prevent regressions.

@geeksilva97

Copy link
Copy Markdown
Contributor Author

Not saying whether or not we should land this, but https://github.com/nodejs/node/blob/main/deps/sqlite/unofficial.gni should be updated, and there should be at least one test for each new API to prevent regressions.

Good point. Also, I think it would be good to have some benchmarks on sqlite implementations.

@geeksilva97
geeksilva97 force-pushed the enable-common-sqlite-flags branch from 9590dee to 0c1ec86 Compare March 25, 2025 19:22
@geeksilva97

Copy link
Copy Markdown
Contributor Author

Not saying whether or not we should land this, but https://github.com/nodejs/node/blob/main/deps/sqlite/unofficial.gni should be updated, and there should be at least one test for each new API to prevent regressions.

@cjihrig , what's the difference between .gyp and .gni file?

Comment thread test/parallel/test-sqlite.js Resolved
@geeksilva97
geeksilva97 force-pushed the enable-common-sqlite-flags branch from 0c1ec86 to 31c5aa5 Compare March 25, 2025 19:28
@cjihrig

cjihrig commented Mar 25, 2025

Copy link
Copy Markdown
Contributor

what's the difference between .gyp and .gni file?

They are for two different build systems. The .gyp file is used by the official build. The .gni file is used by the unofficial GN build.

@geeksilva97

Copy link
Copy Markdown
Contributor Author

what's the difference between .gyp and .gni file?

They are for two different build systems. The .gyp file is used by the official build. The .gni file is used by the unofficial GN build.

Thank you!

@cjihrig

cjihrig commented Mar 25, 2025

Copy link
Copy Markdown
Contributor

even though it does not enable the RBU extension.

Why not? And why not the Geopoly extension?

@geeksilva97

geeksilva97 commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor Author

even though it does not enable the RBU extension.

Why not? And why not the Geopoly extension?

For RBU, I didn't see it in better-sqlite3 or node-sqlite3. Geopoly seems like a good extension to have.

@geeksilva97

geeksilva97 commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor Author

even though it does not enable the RBU extension.

Why not? And why not the Geopoly extension?

For RBU, I didn't see it in better-sqlite3 or node-sqlite3. Geopoly seems like a good extension to have.

On the other hand, the issue mentions the SQLite Amalgamation. I think we could have RBU enabled.

The amalgamation contains everything you need to integrate SQLite into a larger project

@codecov

codecov Bot commented Mar 25, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.23%. Comparing base (1b5b019) to head (c22f75e).
Report is 69 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57621      +/-   ##
==========================================
+ Coverage   90.22%   90.23%   +0.01%     
==========================================
  Files         630      630              
  Lines      185054   185055       +1     
  Branches    36254    36219      -35     
==========================================
+ Hits       166963   166985      +22     
- Misses      11032    11037       +5     
+ Partials     7059     7033      -26     

see 45 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TheOneTheOnlyJJ TheOneTheOnlyJJ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo

Comment thread test/parallel/test-sqlite.js Resolved
@geeksilva97
geeksilva97 force-pushed the enable-common-sqlite-flags branch from 31c5aa5 to 3f64dfa Compare March 26, 2025 13:49
Comment thread test/parallel/test-sqlite.js Resolved

@cjihrig cjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, but changes LGTM.

Comment thread test/parallel/test-sqlite.js Resolved
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
);
});

test('fts3 parenthesis', (t) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inconsistent with the rest, missing is enabled in its name.

Comment thread test/parallel/test-sqlite.js Resolved

@cjihrig cjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still unsure whether or not we want all of these enabled, but giving this a LGTM so it's not stalled.

@cjihrig cjihrig added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Apr 3, 2025
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Apr 3, 2025
@jlarmstrongiv

jlarmstrongiv commented Apr 28, 2026 •

Copy link
Copy Markdown

More common flags that are missing are SQLITE_ENABLE_UPDATE_DELETE_LIMIT and SQLITE_ENABLE_NULLS_LAST_IN_INDEX

inovaprog added a commit to inovaprog/bound-code that referenced this pull request Aug 18, 2026
node:sqlite only ships FTS5 compiled in by default starting at Node
22.16.0 (nodejs/node#57621), not 22.13 as previously declared. Below
that patch, the first `bound index` call throws `no such module:
fts5` from saveFunctionGraph. This had been silently broken since
0.1.0 shipped -- CI itself was pinned to 22.13.x and had been red
since the first public push. Found while validating the new release
workflow against a real GitHub Actions runner.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
krapie added a commit to krapie/mycelium that referenced this pull request Aug 23, 2026
* coverage.yml: stop pinning to .nvmrc's exact floor version

Discovered why the workflow failed after merging: node:sqlite only
gained FTS5 support in Node 22.16.0 (nodejs/node#57621, verified). This
repo's stated floor (.nvmrc/engines.node: >=22.13.0) predates that, so
pinning to it exactly makes test/organize.test.js's index-db-backed
tests throw 'no such module: fts5' — a real, pre-existing gap ci.yml
never caught because it floats to whatever '22.x' currently resolves
to (22.23.2), not the literal floor.

This commit only fixes the coverage workflow (match ci.yml's floating
22.x). Whether to bump the actual floor to >=22.16.0 is a separate,
bigger decision — left to the maintainer.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Bump the Node floor to >=22.16.0, where node:sqlite FTS5 actually works

.nvmrc, package.json/package-lock.json's engines.node, README's badge
+ Requirements line, and CONTRIBUTING.md's Requirements all bumped
22.13 -> 22.16.

Now that the floor genuinely has FTS5, coverage.yml's workaround from
the previous commit (floating '22.x' instead of node-version-file:
.nvmrc) is unnecessary — reverted back to .nvmrc, which is now correct
again and will keep tracking whatever this repo's floor actually is.

npm install also picked up a pre-existing, unrelated drift in
package-lock.json's own version field (0.1.0 -> 0.1.5, matching
package.json — lockfile just hadn't been regenerated in a while).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
ionutsss1 added a commit to ionutsss1/whatsapp-mcp that referenced this pull request Sep 22, 2026
CI on Node 22.13.0 failed with "no such module: fts5": Node only compiles
its bundled SQLite with FTS5 since 22.16.0 (nodejs/node#57621). Raise
engines and the CI floor to match. On a Node without FTS5, openDb now
says which version is needed instead of surfacing SQLite's error.

Also rewords the message shown when another install's bridge holds the port.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tacck added a commit to tacck/lockage that referenced this pull request Oct 14, 2026
* ci: add GitHub Actions publish (Trusted Publishing/OIDC) + version-bump, Git Flow docs, root AGENTS.md (#12)

- publish.yml: on push to main, publish only when version is unpublished;
  authenticate via npm Trusted Publishing (OIDC, id-token: write, no NPM_TOKEN);
  upgrade npm to >=11.5.1 on Node 22.14; three-file version gate; tag vX.Y.Z.
- version-bump.yml: workflow_dispatch patch/minor/major, sync 3 version files +
  lockfile, open PR targeting dev.
- package.json: add repository field (required for Trusted Publishing).
- docs/branch-strategy.md (new, English), root AGENTS.md (new, references it).
- docs/releasing.md and releasing_ja.md: rewrite to the CI + OIDC flow.

* fix(ci): pin npm upgrade to npm@^11 in publish workflow (#14)

npm@latest is now 12.x, which requires Node ^22.22.2 and fails with
EBADENGINE on the Node 22.14 the workflow pins, breaking the publish run.
npm@11 (11.21.x) satisfies the Trusted Publishing floor (>=11.5.1) and
supports Node >=22.9.0, so it works on Node 22.14.

* fix(ci): bump publish workflow Node to 22.22 for node:sqlite FTS5

The publish workflow pinned node-version '22.14', whose bundled node:sqlite
has no FTS5 (enabled upstream in Node 24.0.0 via nodejs/node#57621 and
backported to 22.16). On 22.14 every board/ticket test aborts with
'no such module: fts5', so the Test step fails before publish can run.

Verified by hand: FTS5 is absent on 22.14/22.15 and present from 22.16
onward (22.16/22.22/24 all OK). Pin to 22.22; it keeps npm@^11 (needs Node
>= 22.9.0) working and the full suite passes 417/417 on linux Node 22.22.
tacck added a commit to tacck/lockage that referenced this pull request Oct 17, 2026
* ci: add GitHub Actions publish (Trusted Publishing/OIDC) + version-bump, Git Flow docs, root AGENTS.md (#12)

- publish.yml: on push to main, publish only when version is unpublished;
  authenticate via npm Trusted Publishing (OIDC, id-token: write, no NPM_TOKEN);
  upgrade npm to >=11.5.1 on Node 22.14; three-file version gate; tag vX.Y.Z.
- version-bump.yml: workflow_dispatch patch/minor/major, sync 3 version files +
  lockfile, open PR targeting dev.
- package.json: add repository field (required for Trusted Publishing).
- docs/branch-strategy.md (new, English), root AGENTS.md (new, references it).
- docs/releasing.md and releasing_ja.md: rewrite to the CI + OIDC flow.

* fix(ci): pin npm upgrade to npm@^11 in publish workflow (#14)

npm@latest is now 12.x, which requires Node ^22.22.2 and fails with
EBADENGINE on the Node 22.14 the workflow pins, breaking the publish run.
npm@11 (11.21.x) satisfies the Trusted Publishing floor (>=11.5.1) and
supports Node >=22.9.0, so it works on Node 22.14.

* fix(ci): bump publish workflow Node to 22.22 for node:sqlite FTS5

The publish workflow pinned node-version '22.14', whose bundled node:sqlite
has no FTS5 (enabled upstream in Node 24.0.0 via nodejs/node#57621 and
backported to 22.16). On 22.14 every board/ticket test aborts with
'no such module: fts5', so the Test step fails before publish can run.

Verified by hand: FTS5 is absent on 22.14/22.15 and present from 22.16
onward (22.16/22.22/24 all OK). Pin to 22.22; it keeps npm@^11 (needs Node
>= 22.9.0) working and the full suite passes 417/417 on linux Node 22.22.

* chore: pin npx lockage invocations to the package version (#19)

* feat: pin npx lockage invocations to the package version and add sync:versions

Extract readPackageVersion into src/version.ts, pin the 3 MCP defs and 4 static hook defs to lockage@0.9.4, embed lockage@${version} in setup-kiro.ts generated hooks, and add scripts/sync-versions.ts (--check fail-closed + rewrite) with a sync:versions npm script. Supply-chain hardening: an installed config keeps invoking a known version instead of latest.

* test: add fail-closed pin gate and update tests to pinned npx form

* docs: document the pinned npx policy and sync it in version-bump CI

* docs: state the branch-off-dev / PR-to-dev flow in AGENTS.md (#20)
tacck added a commit to tacck/lockage that referenced this pull request Oct 17, 2026
* ci: add GitHub Actions publish (Trusted Publishing/OIDC) + version-bump, Git Flow docs, root AGENTS.md (#12)

- publish.yml: on push to main, publish only when version is unpublished;
  authenticate via npm Trusted Publishing (OIDC, id-token: write, no NPM_TOKEN);
  upgrade npm to >=11.5.1 on Node 22.14; three-file version gate; tag vX.Y.Z.
- version-bump.yml: workflow_dispatch patch/minor/major, sync 3 version files +
  lockfile, open PR targeting dev.
- package.json: add repository field (required for Trusted Publishing).
- docs/branch-strategy.md (new, English), root AGENTS.md (new, references it).
- docs/releasing.md and releasing_ja.md: rewrite to the CI + OIDC flow.

* fix(ci): pin npm upgrade to npm@^11 in publish workflow (#14)

npm@latest is now 12.x, which requires Node ^22.22.2 and fails with
EBADENGINE on the Node 22.14 the workflow pins, breaking the publish run.
npm@11 (11.21.x) satisfies the Trusted Publishing floor (>=11.5.1) and
supports Node >=22.9.0, so it works on Node 22.14.

* fix(ci): bump publish workflow Node to 22.22 for node:sqlite FTS5

The publish workflow pinned node-version '22.14', whose bundled node:sqlite
has no FTS5 (enabled upstream in Node 24.0.0 via nodejs/node#57621 and
backported to 22.16). On 22.14 every board/ticket test aborts with
'no such module: fts5', so the Test step fails before publish can run.

Verified by hand: FTS5 is absent on 22.14/22.15 and present from 22.16
onward (22.16/22.22/24 all OK). Pin to 22.22; it keeps npm@^11 (needs Node
>= 22.9.0) working and the full suite passes 417/417 on linux Node 22.22.

* chore: pin npx lockage invocations to the package version (#19)

* feat: pin npx lockage invocations to the package version and add sync:versions

Extract readPackageVersion into src/version.ts, pin the 3 MCP defs and 4 static hook defs to lockage@0.9.4, embed lockage@${version} in setup-kiro.ts generated hooks, and add scripts/sync-versions.ts (--check fail-closed + rewrite) with a sync:versions npm script. Supply-chain hardening: an installed config keeps invoking a known version instead of latest.

* test: add fail-closed pin gate and update tests to pinned npx form

* docs: document the pinned npx policy and sync it in version-bump CI

* docs: state the branch-off-dev / PR-to-dev flow in AGENTS.md (#20)

* fix(ci): install deps before sync:versions in version-bump workflow (#22)

The version-bump workflow failed in CI with exit 127 (tsx: not found):
the 'Sync pinned npx versions' step runs 'npm run sync:versions'
(tsx scripts/sync-versions.ts), but node_modules was never installed.
Add an 'npm ci' step after Setup Node.js (matching publish.yml).

Verification:
- npm run typecheck: passed
- npm test: 418 passing; 1 pre-existing failure in test/worktree.test.ts
  (git worktree ref/SHA assertion) reproduced on the clean baseline with
  this change stashed, so it is unrelated to this YAML-only edit.
- YAML: no js-yaml/python-yaml available; validated by careful manual
  re-read (indentation and step structure match surrounding steps).

* chore: bump version to v0.9.5 (patch)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
lawwu added a commit to lawwu/html-server that referenced this pull request Oct 29, 2026
The first CI run on Node 22.13, the minimum package.json gave, failed every test that
opens a database with "no such module: fts5": Node's bundled SQLite gained FTS5 in 22.16
(nodejs/node#57621), and StatementSync.columns(), which the Cloudflare adapter's test
uses, arrived then too. The search index is FTS5, so the server couldn't start on 22.13
to 22.15. The stated minimum, the README and CI's oldest Node now say 22.16.
blakenetz added a commit to blakenetz/newsletterss-mcp that referenced this pull request Oct 30, 2026
engines: ^22.16.0 || >=24.0.0 — node:sqlite gained FTS5 in 22.16.0 and 24.0.0 (nodejs/node#57621); 22.15.x and 23.x lack it. CI reads .nvmrc; Docker base pinned to node:26.13.0-slim.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. dependencies PRs that add, update, or configure Node.js dependencies. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants