github mksglu/context-mode v1.0.27

latest releases: v1.0.33, v1.0.32, v1.0.31...
8 hours ago

bun:sqlite Fallback Adapter

Bun runtime is now fully supported. Users running context-mode under Bun (e.g. OpenCode, custom setups) no longer crash with "better-sqlite3 is not yet supported in Bun". The plugin transparently falls back to Bun's built-in bun:sqlite module.

What changed

  • BunSQLiteAdapter — wraps bun:sqlite with a better-sqlite3-compatible API. Bridges .pragma(), multi-statement .exec(), and .get() null→undefined conversion.

  • loadDatabase() fallback — tries better-sqlite3 first (Node.js), catches failure → detects globalThis.Bun → loads bun:sqlite via adapter. Zero config, zero user action needed.

  • SQL-aware statement splittingexec() splits multi-statement SQL respecting string literals (won't break on ';' inside quotes).

  • Direct import fixesserver.ts (ctx_stats) and cli.ts (doctor) previously hardcoded require("better-sqlite3"), bypassing the fallback. Now use loadDatabase().

TDD

8 new tests covering: pragma scalar/array, multi-statement exec, semicolons in string literals, get() null→undefined, run() return shape, transactions, and interface completeness.

Verification

  • TypeScript: PASS
  • esbuild bundle: PASS (bun:sqlite not statically resolved — uses Array.join() trick)
  • Full test suite: 1166 tests, 39 files, 3 OS — all green
  • 6-agent architecture review: CI, API compat, cross-OS, adapters/plugins, docs, test coverage

Closes #45


Full diff: v1.0.26...v1.0.27

Don't miss a new context-mode release

NewReleases is sending notifications on new releases.