Skip to content

Conversation

@brainkim
Copy link
Member

Summary

Adds @b9g/zen/sqlite-opfs entrypoint - a SQLite driver for browsers using OPFS persistence.

Usage

// worker.ts
import { createSQLiteOPFSDriver } from "@b9g/zen/sqlite-opfs";
import { Database } from "@b9g/zen";

const driver = await createSQLiteOPFSDriver("myapp.db");
const db = new Database(driver);
await db.open(1);

Technical Details

  • Uses @sqlite.org/sqlite-wasm with opfs-sahpool VFS
  • No COOP/COEP headers required
  • Fastest OPFS performance (3-4x faster than alternatives)
  • Must run in Web Worker
  • Single connection (no multi-tab, but that's fine for most use cases)

Status

Draft - Pending browser tests via libuild multiplatform test runner.

The driver code mirrors the tested sqlite.ts driver, but the WASM integration needs real browser testing before merging.

Test plan

  • libuild multiplatform test runner available
  • Add Playwright/browser tests
  • Manual testing via playground

🤖 Generated with Claude Code

Adds @b9g/zen/sqlite-opfs entrypoint using @sqlite.org/sqlite-wasm
with opfs-sahpool VFS for persistent browser storage.

- No COOP/COEP headers required
- Must run in Web Worker
- Fastest OPFS performance (3-4x faster than alternatives)

Note: Untested pending libuild multiplatform test runner.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@brainkim
Copy link
Member Author

Blocked by bikeshaving/libuild#3

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.

2 participants