Skip to content

Commit a7d858e

Browse files
kevin-dpcursoragentautofix-ci[bot]claude
authored
feat: Cloudflare DO SQLite persisted collection (#1360)
* docs: add sqlite persistence plan and phased guard rails * feat: add sqlite persisted collection core phase-0 package * feat(db): harden index lifecycle contract for phase-2 bootstrap * feat: add time-based applied_tx pruning policy * feat: add node sqlite persisted collection package * fix: add better-sqlite3 type definitions for node adapter * feat: add electron sqlite ipc bridge package * test: add portable runtime bridge e2e contract * ci: apply automated fixes * fix: stabilize electron runtime bridge e2e harness * test: run electron runtime e2e via built fixtures * fix: use cjs preload for electron runtime bridge e2e * feat: add react-native/expo sqlite persisted collection package * ci: apply automated fixes * fix: align mobile adapter typing and burst persistence test * ci: apply automated fixes * feat: add cloudflare DO sqlite persistence with wrangler e2e * test: harden cloudflare DO schema and transaction semantics * docs: add complete API readmes for sqlite persistence packages * refactor: unify sqlite persistence APIs around shared persisters * refactor: simplify sqlite persistence APIs across runtimes * fix: narrow generic adapter cast in cloudflare persistence * fix(cloudflare-e2e): use collection-resolved adapter in worker fixture * feat(sqlite): accept native runtime handles in persistence factories * refactor(persistence): require native sqlite handles only * chore: refresh pnpm lockfile for cloudflare package peers * ci: apply automated fixes * feat(browser): implement phase 7 single-tab persistence * fix(browser): move phase 7 opfs path into worker * docs: update phase 8 plan with implementation status annotations Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: apply automated fixes * feat(browser): implement Phase 8 BrowserCollectionCoordinator for multi-tab support Web Locks for per-collection leadership election, BroadcastChannel for cross-tab RPC transport, DB writer lock for SQLite write serialization, envelope dedup for exactly-once mutations, and leader heartbeats. Includes 15 unit tests with Web Locks/BroadcastChannel mocks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: apply automated fixes * chore: extract electron, node, and cloudflare persistence packages to follow-up branches Remove db-electron-sqlite-persisted-collection, db-node-sqlite-persisted-collection, and db-cloudflare-do-sqlite-persisted-collection from this branch so it contains only the core persistence packages (db, db-sqlite-persisted-collection-core, db-browser-wa-sqlite-persisted-collection, db-react-native-sqlite-persisted-collection). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add node and cloudflare DO sqlite persisted collection packages Restore db-node-sqlite-persisted-collection (better-sqlite3 driver) and db-cloudflare-do-sqlite-persisted-collection (Durable Object driver) with their test suites and e2e configurations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove node sqlite package (moved to electron branch) The node SQLite driver is needed by the electron package tests, so it has been moved to the kevin/persistence-electron branch instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: regenerate pnpm-lock.yaml after rebase on main Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove duplicate CollectionIndexMetadata export from rebase Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove duplicate age-based pruning block causing deadlock in CF DO driver The rebase duplicated the applied_tx age-based pruning DELETE. The second copy used this.driver instead of the transaction driver parameter, which deadlocked the cloudflare DO driver's serialized queue. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove duplicate type definition from rebase in electron e2e fixtures Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use objectContaining in e2e contract to handle virtual props The runtime bridge e2e test used exact equality which fails now that collections include virtual props ($collectionId, $key, $origin, $synced). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove electron/node changeset that belongs to a different branch Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: restore electron and node packages removed by stale extraction commits These packages were removed from this branch before they were merged to main. Now that they're on main, the extraction commits incorrectly delete them during rebase. Restore them from main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ci: restore node and electron e2e test steps in workflow These were removed by the extraction commits but the packages are back on main now. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6cce9ff commit a7d858e

32 files changed

+4761
-19
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/db-cloudflare-do-sqlite-persisted-collection': patch
3+
---
4+
5+
feat(persistence): add SQLite persistence support for Cloudflare Durable Objects runtime

.changeset/paid-gems-sell.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/e2e-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ jobs:
7272
cd packages/db-electron-sqlite-persisted-collection
7373
TANSTACK_DB_ELECTRON_E2E_ALL=1 pnpm test:e2e
7474
75+
- name: Run Cloudflare Durable Object persisted collection E2E tests
76+
run: |
77+
cd packages/db-cloudflare-do-sqlite-persisted-collection
78+
pnpm test:e2e
79+
7580
- name: Run React Native/Expo persisted collection E2E tests
7681
run: |
7782
cd packages/db-react-native-sqlite-persisted-collection

0 commit comments

Comments
 (0)