Skip to content

feat(storage): Durable Object SQLite driver and SQL, layered and fetcher blob stores (RFC-0036 phase 1) - #22

Merged
Madraka merged 1 commit into
mainfrom
feat/storage-do-sqlite
Oct 20, 2026
Merged

Madraka merged 1 commit into
mainfrom
feat/storage-do-sqlite

Conversation

@Madraka

@Madraka Madraka commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

RFC-0036 phase 1 (ADR-0038, in #10).

  • @cloudhal/storage/do-sqlite: DoSqliteDriver over a SQLite-backed Durable Object's ctx.storage. batch runs inside transactionSync (a throw rolls everything back) and is never handed to callers; BEGIN stays refused; D1 limits enforced like every adapter.
  • Root exports: SqlBlobStore (blobs in a _blobs table of the same database, SHA-256 recorded and checked, per-object cap default 1 MiB, total cap checked in the writing statement), LayeredBlobStore (writable upper over read-only base, merged list, deletes never touch the base), FetcherBlobStore (read-only over an ASSETS binding, keys for list).
  • @cloudhal/storage/testing: createMiniflareDoSqlite() runs the real driver inside a test-only Durable Object on Miniflare; Node gets a driver whose every call is one request to it.
  • Tests: SqlDriver conformance + every migration (FTS5 included) on DO SQLite; BlobStore conformance for SqlBlobStore on better-sqlite3 and on DO SQLite, and for LayeredBlobStore; cap, prefix and fetcher tests; core-ts describeSiteGraphStore and searchSuite gain a "Durable Object SQLite + sql blobs" backend (68 tests).

pnpm check green locally (run alone).

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 20, 2026 15:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

…her blob stores

RFC-0036 phase 1. @cloudhal/storage/do-sqlite adds DoSqliteDriver over a
SQLite-backed Durable Object's storage: batch runs in transactionSync and
is never exposed as a transaction, D1 limits are enforced as on every
adapter. SqlBlobStore keeps blobs in a table of the same database with an
atomic total cap; LayeredBlobStore reads a writable store over a read-only
one; FetcherBlobStore reads static files from an ASSETS binding.

createMiniflareDoSqlite runs the real driver inside a test Durable Object,
so the storage conformance suites and core-ts's store and search suites
now also run on Durable Object SQLite (all migrations, FTS5 included).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Madraka <[email protected]>
@Madraka
Madraka force-pushed the feat/storage-do-sqlite branch from 2a3d998 to c70d3fa Compare October 20, 2026 15:13
@Madraka
Madraka merged commit 85d1af5 into main Oct 20, 2026
5 checks passed
@Madraka Madraka mentioned this pull request Oct 20, 2026
Madraka added a commit that referenced this pull request Oct 20, 2026
feat(storage): Durable Object SQLite driver and SQL, layered and fetcher blob stores (RFC-0036 phase 1)
Madraka added a commit that referenced this pull request Oct 20, 2026
The public playground (RFC-0036): Durable Object SQLite storage (#22),
playground mode in the API and Studio (#23), and the playground Worker
and PlaygroundSite Durable Object (#24).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Madraka <[email protected]>
@Madraka
Madraka deleted the feat/storage-do-sqlite branch October 20, 2026 21:35
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