Skip to content

sqlite: enable common flags#57621

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

sqlite: enable common flags#57621
nodejs-github-bot merged 2 commits intonodejs:mainfrom
geeksilva97:enable-common-sqlite-flags

Conversation

@geeksilva97
Copy link
Copy Markdown
Contributor

@geeksilva97 geeksilva97 commented Mar 25, 2025

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 Pull requests that update a dependency file. 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
Copy link
Copy Markdown
Contributor

@cjihrig cjihrig left a comment

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 Outdated
@geeksilva97 geeksilva97 force-pushed the enable-common-sqlite-flags branch from 0c1ec86 to 31c5aa5 Compare March 25, 2025 19:28
@cjihrig
Copy link
Copy Markdown
Contributor

cjihrig commented Mar 25, 2025

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
Copy link
Copy Markdown
Contributor

cjihrig commented Mar 25, 2025

even though it does not enable the RBU extension.

Why not? And why not the Geopoly extension?

@geeksilva97
Copy link
Copy Markdown
Contributor Author

geeksilva97 commented Mar 25, 2025

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
Copy link
Copy Markdown
Contributor Author

geeksilva97 commented Mar 25, 2025

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
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2025

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.

Copy link
Copy Markdown
Contributor

@TheOneTheOnlyJJ TheOneTheOnlyJJ left a comment

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 Outdated
@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
Copy link
Copy Markdown
Contributor

@cjihrig cjihrig left a comment

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 Outdated
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 Outdated
Copy link
Copy Markdown
Contributor

@cjihrig cjihrig left a comment

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. label Apr 3, 2025
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 3, 2025
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request May 16, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request May 18, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request May 19, 2025
PR-URL: #57621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@geeksilva97 geeksilva97 deleted the enable-common-sqlite-flags branch May 20, 2025 00:46
@ghost ghost mentioned this pull request Jun 8, 2025
@jlarmstrongiv
Copy link
Copy Markdown

jlarmstrongiv commented Apr 28, 2026

More common flags that are missing are SQLITE_ENABLE_UPDATE_DELETE_LIMIT and SQLITE_ENABLE_NULLS_LAST_IN_INDEX

markus-lassfolk pushed a commit to markus-lassfolk/openclaw-hybrid-memory that referenced this pull request May 8, 2026
22.13 exposes node:sqlite but SQLite was built without FTS5 until 22.16 (nodejs/node#57621).

Co-authored-by: Cursor <cursoragent@cursor.com>
markus-lassfolk pushed a commit to markus-lassfolk/openclaw-hybrid-memory that referenced this pull request May 8, 2026
…gelog

- Pin CI/security to Node 22.16 (node:sqlite + FTS5, nodejs/node#57621)
- engines, .nvmrc, docs: require >=22.16.0
- Tests: storageGrowth nulls vs expect.anything(); EventLog CHECK relaxed
- CHANGELOG [Unreleased]: cron exit validation (#1203) + Node bump
- Biome-format cron exit validator / harness / install paths

Co-authored-by: Cursor <cursoragent@cursor.com>
markus-lassfolk pushed a commit to markus-lassfolk/openclaw-hybrid-memory that referenced this pull request May 8, 2026
- Pin CI/security to Node 22.16 (node:sqlite + FTS5, nodejs/node#57621)
- engines, .nvmrc, docs: require >=22.16.0; sync verify/maintenance copy
- Tests: storageGrowth null handling; EventLog CHECK relaxed
- CHANGELOG [Unreleased]: maintenance LLM tier + Node bump
- Biome-format touched config/CLI files

Co-authored-by: Cursor <cursoragent@cursor.com>
markus-lassfolk pushed a commit to markus-lassfolk/openclaw-hybrid-memory that referenced this pull request May 8, 2026
- Pin CI/security to Node 22.16 (node:sqlite + FTS5, nodejs/node#57621)
- engines, .nvmrc, docs: require >=22.16.0; sync verify/maintenance copy
- Tests: storageGrowth null handling; EventLog CHECK relaxed
- CHANGELOG [Unreleased]: deprecated cron command handling + Node bump

Co-authored-by: Cursor <cursoragent@cursor.com>
markus-lassfolk pushed a commit to markus-lassfolk/openclaw-hybrid-memory that referenced this pull request May 8, 2026
- Pin CI/security to Node 22.16 (node:sqlite + FTS5, nodejs/node#57621)
- engines, .nvmrc, docs: require >=22.16.0; sync verify/maintenance copy
- Tests: storageGrowth null handling; EventLog CHECK relaxed
- CHANGELOG [Unreleased]: Node requirement under Changed

Co-authored-by: Cursor <cursoragent@cursor.com>
markus-lassfolk added a commit to markus-lassfolk/openclaw-hybrid-memory that referenced this pull request May 8, 2026
* Initial plan

* Add JSON output to config command, features command, and consolidate-episodes deprecation notice

Agent-Logs-Url: https://github.com/markus-lassfolk/openclaw-hybrid-memory/sessions/25f77f4e-1ea6-444b-b0b2-60f98bd13a4d

Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>

* Update CHANGELOG with new CLI commands and fixes

Agent-Logs-Url: https://github.com/markus-lassfolk/openclaw-hybrid-memory/sessions/25f77f4e-1ea6-444b-b0b2-60f98bd13a4d

Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>

* fix(ci): Node 22.13 for node:sqlite; Biome-format hybrid-mem CLI

- CI/security: pin Node 22 jobs to 22.13 (22.12 needs --experimental-sqlite)
- engines, .nvmrc, docs: require >=22.13.0; sync verify/maintenance copy
- Format cmd-config and register-corrections-and-pipeline with Biome

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ci): require Node 22.16 for node:sqlite FTS5 support

22.13 exposes node:sqlite but SQLite was built without FTS5 until 22.16 (nodejs/node#57621).

Co-authored-by: Cursor <cursoragent@cursor.com>

* test: align audit-health and event-log expectations with Vitest and schema

- expect.anything() does not match null (storageGrowth delta fields)
- EventLog no longer applies CHECK on event_type after relaxation migration

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(memory-hybrid): config JSON contract, format validation, consolidate shim

- Versioned config-view JSON summary + wal/ambient/futureDateProtection toggles.
- features command emits features-only JSON; validate config --format.
- consolidate-episodes exits 0 with deprecation warning; changelog aligned.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>
Co-authored-by: Ralph <ralph@openclaw.dev>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: OpenClaw Agent <agent@openclaw.dev>
markus-lassfolk added a commit to markus-lassfolk/openclaw-hybrid-memory that referenced this pull request May 8, 2026
…1214)

* Initial plan

* fix: add timeout protection and partial result handling to audit-health

- Add `status` field ("ok"|"partial"|"failed") and `errors` array to AuditHealthReport schema
- Keep backward-compatible `ok` field (deprecated)
- Add 5000-row LIMIT to implicitFeedbackPrefixHistogram query to prevent scanning huge fact tables
- Wrap prefix histogram in try-catch with error tracking
- Add 5-second timeout for LanceDB size calculation (getStorageSizes)
- Update strict mode to check both status and ok fields
- Update markdown printer to show errors section
- Update tests to validate new schema fields

Fixes hang on long-lived stores by bounding expensive operations.

Agent-Logs-Url: https://github.com/markus-lassfolk/openclaw-hybrid-memory/sessions/64bfcd5d-27d4-4a78-b223-6142f3a0b1ab

Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>

* docs: add CHANGELOG entry for audit-health timeout fix

Agent-Logs-Url: https://github.com/markus-lassfolk/openclaw-hybrid-memory/sessions/64bfcd5d-27d4-4a78-b223-6142f3a0b1ab

Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>

* fix(ci): Node 22.16 + FTS5; Vitest audit-health/event-log; changelog

- Pin CI/security to Node 22.16 (node:sqlite + FTS5, nodejs/node#57621)
- engines, .nvmrc, docs: require >=22.16.0; sync verify/maintenance copy
- Tests: storageGrowth null handling; EventLog CHECK relaxed
- CHANGELOG [Unreleased]: Node requirement under Changed

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(memory-hybrid): audit-health status, Lance size timeout, and changelog ref

- Derive partial status when warnings or report errors exist; align legacy ok flag.
- Record LanceDB du timeout in report.errors; kill du via execFile timeout.
- Rename misleading EventLog test describe; changelog references #1214.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(memory-hybrid): detect implicit-feedback histogram truncation via LIMIT+1

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>
Co-authored-by: Ralph <ralph@openclaw.dev>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: OpenClaw Agent <agent@openclaw.dev>
markus-lassfolk pushed a commit to markus-lassfolk/openclaw-hybrid-memory that referenced this pull request May 8, 2026
* Initial plan

* Fix stale consolidate-episodes references in cron/verify

* fix(ci): Node 22.16 + FTS5; Vitest audit-health/event-log; changelog

- Pin CI/security to Node 22.16 (node:sqlite + FTS5, nodejs/node#57621)
- engines, .nvmrc, docs: require >=22.16.0; sync verify/maintenance copy
- Tests: storageGrowth null handling; EventLog CHECK relaxed
- CHANGELOG [Unreleased]: deprecated cron command handling + Node bump

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(memory-hybrid): robust HM_EXIT scan for deprecated cron steps

- Recursively collect recent .exit.txt under cron-hybrid-mem (flat + subdirs).
- Per-file read isolation; escape regex metacharacters in deprecated tokens.
- Tests: mkdtemp + cleanup; cover exit ledger path collection.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(memory-hybrid): skip deprecated-cron warnings for feature-gated jobs

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: openai-code-agent[bot] <242516109+Codex@users.noreply.github.com>
Co-authored-by: Ralph <ralph@openclaw.dev>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: OpenClaw Agent <agent@openclaw.dev>
markus-lassfolk added a commit to markus-lassfolk/openclaw-hybrid-memory that referenced this pull request May 8, 2026
* Initial plan

* feat(memory-hybrid): add maintenance LLM tier and routing warnings

Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>

* fix(ci): Node 22.16 + FTS5; Vitest audit-health/event-log; changelog

- Pin CI/security to Node 22.16 (node:sqlite + FTS5, nodejs/node#57621)
- engines, .nvmrc, docs: require >=22.16.0; sync verify/maintenance copy
- Tests: storageGrowth null handling; EventLog CHECK relaxed
- CHANGELOG [Unreleased]: maintenance LLM tier + Node bump
- Biome-format touched config/CLI files

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(memory-hybrid): align reflection routing with maintenance tier and docs

- Route reflect/reflect-rules/reflect-meta through maintenance tier and
  default reflectionConfig.model from that tier.
- Derive extraction heavy-model warnings from filtered tier preferences.
- Correct distill.extractionModelTier schema/docs: unset defaults to nano.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(memory-hybrid): derive dream-cycle heavy warning from filtered maintenance tier

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: openai-code-agent[bot] <242516109+Codex@users.noreply.github.com>
Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>
Co-authored-by: Ralph <ralph@openclaw.dev>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: OpenClaw Agent <agent@openclaw.dev>
markus-lassfolk added a commit to markus-lassfolk/openclaw-hybrid-memory that referenced this pull request May 8, 2026
…on (#1204)

* Initial plan

* Add exit ledger validation for cron jobs

- Create cron-exit-validator.ts with structured validation
- Add validate-cron-exit CLI command for internal use
- Update cron job bash harness with validation instructions
- Add comprehensive tests for exit ledger parsing and validation
- Register new validation command in CLI

Agent-Logs-Url: https://github.com/markus-lassfolk/openclaw-hybrid-memory/sessions/cd60b52e-d486-4166-b77f-63a3040389a2

Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>

* Add message normalization to fix obsolete cron commands

- Update existing cron job messages when normalizeExisting=true
- Remove obsolete command references (e.g., consolidate-episodes)
- Convert tests to vitest format
- All 14 tests passing

Agent-Logs-Url: https://github.com/markus-lassfolk/openclaw-hybrid-memory/sessions/cd60b52e-d486-4166-b77f-63a3040389a2

Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>

* Add comprehensive documentation for cron exit validation

- Document validation behavior and expected outcomes
- Explain migration path for existing installations
- Detail config-based skipping mechanism
- List acceptance criteria and testing coverage

Agent-Logs-Url: https://github.com/markus-lassfolk/openclaw-hybrid-memory/sessions/cd60b52e-d486-4166-b77f-63a3040389a2

Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>

* fix(ci): Node 22.16 + FTS5; Vitest audit-health/event-log tests; changelog

- Pin CI/security to Node 22.16 (node:sqlite + FTS5, nodejs/node#57621)
- engines, .nvmrc, docs: require >=22.16.0
- Tests: storageGrowth nulls vs expect.anything(); EventLog CHECK relaxed
- CHANGELOG [Unreleased]: cron exit validation (#1203) + Node bump
- Biome-format cron exit validator / harness / install paths

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(memory-hybrid): use Number.parseInt in cron-exit-validator (Biome error)

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(memory-hybrid): treat all-missing exit ledger as failed, not skipped

Empty or step-less HM_EXIT cannot distinguish guard skip from abort before
hm_step; report failure so validate-cron-exit surfaces the error.

Co-authored-by: chatgpt-codex-connector <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(memory-hybrid): respect messageOverrides during cron normalizeExisting

Apply overrides to payload.message for agentTurn jobs and skip canonical
message replacement when a per-job override is provided.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cron): treat empty exit ledger as skipped when log shows feature-gated skip

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>
Co-authored-by: Ralph <ralph@openclaw.dev>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: chatgpt-codex-connector <noreply@openai.com>
Co-authored-by: OpenClaw Agent <agent@openclaw.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. dependencies Pull requests that update a dependency file. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants