You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(sqlite-persistence): prune applied_tx by default with safe replay recovery (#1572)
* feat(node-db-sqlite-persistence): prune applied_tx by default
createNodeSQLitePersistence left appliedTxPruneMaxRows/appliedTxPruneMaxAgeSeconds unset, so the applied_tx log grew without bound for every consumer. Default them to 1,000 rows and a 24h age backstop (both overridable; pass 0 to disable), exported as DEFAULT_APPLIED_TX_PRUNE_MAX_ROWS / DEFAULT_APPLIED_TX_PRUNE_MAX_AGE_SECONDS.
* fix: make sqlite replay pruning recovery-aware
* ci: apply automated fixes
* docs: clarify sqlite pruning scope
* feat: default sqlite applied_tx pruning across wrappers
---------
Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
'@tanstack/capacitor-db-sqlite-persistence': minor
4
+
'@tanstack/cloudflare-durable-objects-db-sqlite-persistence': minor
5
+
'@tanstack/db-sqlite-persistence-core': minor
6
+
'@tanstack/expo-db-sqlite-persistence': minor
7
+
'@tanstack/node-db-sqlite-persistence': minor
8
+
'@tanstack/react-native-db-sqlite-persistence': minor
9
+
'@tanstack/tauri-db-sqlite-persistence': minor
10
+
---
11
+
12
+
SQLite persistence wrappers now prune the `applied_tx` replay log by default so SQLite files no longer grow without bound. When prune options are omitted, wrappers that construct the shared SQLite core adapter apply `appliedTxPruneMaxRows: 1_000` and `appliedTxPruneMaxAgeSeconds: 86_400` (24h). Both remain overridable, and passing `0` disables that limit. The defaults are exported as `DEFAULT_APPLIED_TX_PRUNE_MAX_ROWS` and `DEFAULT_APPLIED_TX_PRUNE_MAX_AGE_SECONDS` from the shared SQLite core package and re-exported by wrapper packages.
13
+
14
+
The shared SQLite core adapter now treats `applied_tx` as a bounded replay cache during `pullSince` recovery. If a recovery request starts before the retained replay window, `pullSince` returns `requiresFullReload: true` instead of returning partial deltas.
0 commit comments