Skip to content

Harden and extend sqlite-wasm-rs OPFS - #34

Open
findolor wants to merge 1 commit into
codex/vendor-sqlite-wasm-rsfrom
codex/extend-sqlite-wasm-rs-opfs
Open

findolor wants to merge 1 commit into
codex/vendor-sqlite-wasm-rsfrom
codex/extend-sqlite-wasm-rs-opfs

Conversation

@findolor

@findolor findolor commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Chained PRs

  1. Vendor sqlite-wasm-rs 0.3.0 #33 — vendor the upstream dependency.
  2. This PR: harden and extend its WASM/OPFS layer.
  3. Add streaming SQLite snapshot installation #32 — expose snapshot installation through SQLite Web.

Motivation

Large browser databases need bounded-memory writes and path-level activation primitives before SQLite Web can safely install streamed snapshots. Review of the unchanged vendor baseline also exposed upstream VFS and time-conversion defects that belong in this modification layer.

Solution

  • Add OpfsSAHPoolImport, which appends chunks directly to an OPFS SAH-pool slot.
  • Validate the SQLite header and minimum/page-aligned file size before publishing.
  • Clean up incomplete imports on error or drop.
  • Add begin_import_db, has_path, and rename_path operations for staging, backup, activation, and rollback.
  • Preserve compatible legacy metadata and assign SQLite's v2 metadata digest to new entries.
  • Propagate OPFS size/deletion failures as SQLite I/O errors.
  • Bound path copies, support null temporary filenames, improve random bytes, and correct local-time conversion.
  • Resolve scheme-qualified database paths against legacy names first, with canonical rooted-path fallback, so imported snapshots reopen through the SQLite VFS without copying bytes.

This layer remains application-agnostic and does not add the SQLite Web snapshot API.

Review-loop fixes

Codex review hardened failure cleanup, rename/import atomicity, metadata compatibility, path validation, temporary-file handling, time conversion, and deterministic legacy/canonical path resolution. Generated build artifacts were removed from the commit.

Verification

  • workspace WASM compile passed
  • 24/24 vendor Chrome worker regressions passed
  • formatting and git diff --check passed
  • two independent final Codex reviews were clean

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 085c1e58-0f72-4755-b5dc-ec3646476ceb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@findolor
findolor force-pushed the codex/extend-sqlite-wasm-rs-opfs branch from c92adf4 to 197c158 Compare September 13, 2026 13:36
@findolor findolor changed the title Add streaming OPFS database imports Harden and extend sqlite-wasm-rs OPFS Sep 13, 2026
@findolor

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@findolor
findolor force-pushed the codex/extend-sqlite-wasm-rs-opfs branch from 197c158 to 6c41f37 Compare September 16, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant