Skip to content
Source
Sign inSign up
TanStack/db

feat(sqlite-persistence): render completed progressive snapshots on startup #2203

ClosedJose10go(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/2203/headopened

Showing 15 changed files with 46 additions and 2 deletions (loading 12).

x
0 of 15 viewed, 15 left
7 additions and 0 deletions.changeset/progressive-persisted-initial-render.mdAdded
View file
@@ -0,0 +1,7 @@
+---
+'@tanstack/db': minor
+'@tanstack/electric-db-collection': minor
+'@tanstack/db-sqlite-persistence-core': minor
+---
+​
+Allow persisted initial rendering from previously completed Electric progressive snapshots. Validate adapter-owned completion metadata and durable row-set evidence before local fallback. Cold, partial, and legacy progressive caches wait for network data; legacy cursors without completion evidence trigger a fresh full sync. Report unavailable snapshots without hanging initial-render waits on network failure.
14 additions and 0 deletionsdocs/collections/electric-collection.mdModified
View file
@@ -339,6 +339,20 @@
```
​
+### Persisted initial rendering with progressive sync
+​
+Progressive sources expose completion evidence to SQLite persistence. Configure
+`initialRender: { strategy: 'network-first', networkTimeoutMs: 0 }` on the
+persisted options to render a previously completed snapshot while syncing.
+Partial caches and cold starts continue to wait for the network. See
+[SQLite persistence](../guides/sqlite-persistence.md#render-after-sqlite-restore).
+​
+Electric writes `snapshotComplete` in its durable resume metadata in the same
+transaction as a completed progressive snapshot. Progressive caches written by
+older versions lack this evidence and conservatively fetch a fresh full snapshot