Open History to see the last commit
1# @tanstack/react-db
2
3## 0.1.88
4
5### Patch Changes
6
7- Updated dependencies [[`307fdf8`](https://github.com/TanStack/db/commit/307fdf80f522a39a50e316316b3b75ba27fd5e84)]:
8 - @tanstack/db@0.6.10
9
10## 0.1.87
11
12### Patch Changes
13
14- Updated dependencies [[`2147345`](https://github.com/TanStack/db/commit/2147345236ceee6e73d9fc6c0cdc2385833199fc), [`00389a4`](https://github.com/TanStack/db/commit/00389a47b258ad58fc3a03c5cc6f66957b9bd2d1)]:
15 - @tanstack/db@0.6.9
16
17## 0.1.86
18
19### Patch Changes
20
21- Updated dependencies [[`3827b62`](https://github.com/TanStack/db/commit/3827b62604bbfc970d80b57479c8da063d78e69d)]:
22 - @tanstack/db@0.6.8
23
24## 0.1.85
25
26### Patch Changes
27
28- Updated dependencies [[`ec59984`](https://github.com/TanStack/db/commit/ec59984dcd8610ad9651c2d32e1361143d44d3c9), [`6238a2d`](https://github.com/TanStack/db/commit/6238a2d80caf4d1cdecaf889fb66bd6ebcc7386a)]:
29 - @tanstack/db@0.6.7
30
31## 0.1.84
32
33### Patch Changes
34
35- Updated dependencies [[`4e9ab39`](https://github.com/TanStack/db/commit/4e9ab39241aae3ba17c8bddf744d566de411f9aa)]:
36 - @tanstack/db@0.6.6
37
38## 0.1.83
39
40### Patch Changes
41
42- Updated dependencies [[`232f228`](https://github.com/TanStack/db/commit/232f22845ddfe179a803a241f95a3375ae63a1fb), [`232f228`](https://github.com/TanStack/db/commit/232f22845ddfe179a803a241f95a3375ae63a1fb)]:
43 - @tanstack/db@0.6.5
44
45## 0.1.82
46
47### Patch Changes
48
49- Add includes (hierarchical data) documentation to all framework SKILL.md files and fix inaccurate toArray scalar select constraint in db-core/live-queries skill. ([#1361](https://github.com/TanStack/db/pull/1361))
50
51- Updated dependencies [[`1e69dd6`](https://github.com/TanStack/db/commit/1e69dd6fac7c9d8d7314af5ce18c33f2006c96b4)]:
52 - @tanstack/db@0.6.4
53
54## 0.1.81
55
56### Patch Changes
57
58- Updated dependencies [[`e29aab3`](https://github.com/TanStack/db/commit/e29aab3ece4420c6959202294777daa606c4b9e4), [`f4a9bd2`](https://github.com/TanStack/db/commit/f4a9bd28c613dc4757f279f292c9276f6a8e012e)]:
59 - @tanstack/db@0.6.3
60
61## 0.1.80
62
63### Patch Changes
64
65- Fix stale status mismatch in useLiveSuspenseQuery causing infinite suspense fallback. ([#1427](https://github.com/TanStack/db/pull/1427))
66
67- Updated dependencies [[`3fe689a`](https://github.com/TanStack/db/commit/3fe689a4444d53a075a0dbe6e2649f8852137fc8), [`c314c36`](https://github.com/TanStack/db/commit/c314c36b8bd02f8be86865c13f31f817ce21dc66)]:
68 - @tanstack/db@0.6.2
69
70## 0.1.79
71
72### Patch Changes
73
74- Update all SKILL.md files to v0.6.0 with new documentation for persistence, virtual properties, queryOnce, createEffect, includes, indexing, and sync metadata. Add tanstack-intent keyword to all packages with skills. ([#1421](https://github.com/TanStack/db/pull/1421))
75
76- Updated dependencies [[`8b7fb1a`](https://github.com/TanStack/db/commit/8b7fb1a18522b8d1c2adb46f5917305c7d99fc4a)]:
77 - @tanstack/db@0.6.1
78
79## 0.1.78
80
81### Patch Changes
82
83- Update dependencies across workspace to resolve version mismatches: `@electric-sql/client` ^1.5.13, `@tanstack/store` ^0.9.2, `pg` ^8.20.0. Adapt subscription cleanup to `@tanstack/store` 0.9.x API which returns `Subscription` objects instead of unsubscribe functions. ([#1381](https://github.com/TanStack/db/pull/1381))
84
85- Updated dependencies [[`f60384b`](https://github.com/TanStack/db/commit/f60384b0fbde019865cbac5a7af341ff8a46d483), [`b8abc02`](https://github.com/TanStack/db/commit/b8abc0230096900746f92c51496489460b4d75e1), [`09c7afc`](https://github.com/TanStack/db/commit/09c7afc47a5ef3f3415ae601b6b00155ab64650b), [`bb09eb1`](https://github.com/TanStack/db/commit/bb09eb1eecbf680bb95a0bb08639f337e9982043), [`179d666`](https://github.com/TanStack/db/commit/179d66685449bcdf9f785c8765bc57cc19c2f7bd), [`43ecbfa`](https://github.com/TanStack/db/commit/43ecbfae5be5e59ffdce6c545d90ca5a810159e6), [`055fd94`](https://github.com/TanStack/db/commit/055fd94bd4654d27d5366af12a90da4c0e670fc0), [`055fd94`](https://github.com/TanStack/db/commit/055fd94bd4654d27d5366af12a90da4c0e670fc0), [`055fd94`](https://github.com/TanStack/db/commit/055fd94bd4654d27d5366af12a90da4c0e670fc0), [`055fd94`](https://github.com/TanStack/db/commit/055fd94bd4654d27d5366af12a90da4c0e670fc0), [`85f5435`](https://github.com/TanStack/db/commit/85f54355a426baefc88ccc55179e0cfcb4dac168), [`b65d8f7`](https://github.com/TanStack/db/commit/b65d8f767dafb1aeede26766c644f9ef0694f20c), [`e0df07e`](https://github.com/TanStack/db/commit/e0df07e1eb2eefbc829407f337cee1d443a7e9b6), [`9952921`](https://github.com/TanStack/db/commit/9952921e02ed8bca5653f0afa64862fc22ffbf9d), [`d351c67`](https://github.com/TanStack/db/commit/d351c677d687e667450138f66ab3bd0e11e7e347)]:
86 - @tanstack/db@0.6.0
87
88## 0.1.77
89
90### Patch Changes
91
92- Add `createEffect` API for reactive delta-driven effects and `useLiveQueryEffect` React hook. ([#1221](https://github.com/TanStack/db/pull/1221))
93
94 `createEffect` attaches callbacks to a live query's delta stream — firing `onEnter`, `onExit`, and `onUpdate` for row-level query-result transitions and `onBatch` for the full delta batch from each graph run — without materialising the full result set. Supports `skipInitial`, `orderBy` + `limit` (top-K window), joins, lazy loading, transaction coalescing, async disposal with `AbortSignal`, and `onSourceError` / `onError` callbacks.
95
96 `useLiveQueryEffect` is the React hook wrapper that manages the effect lifecycle (create on mount, dispose on unmount, recreate on dependency change).
97
98- Updated dependencies [[`c3e6a96`](https://github.com/TanStack/db/commit/c3e6a9654004ce53d429e0ec995738078ab93870)]:
99 - @tanstack/db@0.5.33
100
101## 0.1.76
102
103### Patch Changes
104
105- Updated dependencies [[`eeb5321`](https://github.com/TanStack/db/commit/eeb5321c578ffa2fbdfb7b0b3d64f579d1933522), [`495abc2`](https://github.com/TanStack/db/commit/495abc29fe8c088783b43402c7eeed35566d8524), [`a55e2bf`](https://github.com/TanStack/db/commit/a55e2bf54dbe78128adf5ce26d524a13dedf8145), [`41c0ea2`](https://github.com/TanStack/db/commit/41c0ea2d956f9de37d0216af371f58a461be6f1f)]:
106 - @tanstack/db@0.5.32
107
108## 0.1.75
109
110### Patch Changes
111
112- Add Intent agent skills (SKILL.md files) to guide AI coding agents. Include skills for core DB concepts, all 5 framework bindings, meta-framework integration, and offline transactions. Also add `export * from '@tanstack/db'` to angular-db for consistency with other framework packages. ([#1330](https://github.com/TanStack/db/pull/1330))
113
114- fix(react-db): make getNextPageParam optional in useLiveInfiniteQuery ([#1268](https://github.com/TanStack/db/pull/1268))
115
116- fix(react-db): handle rejected/stale setWindow promises in useLiveInfiniteQuery ([#1269](https://github.com/TanStack/db/pull/1269))
117
118- Updated dependencies [[`bf1d078`](https://github.com/TanStack/db/commit/bf1d078627de150bfca02e2ae2ad8b0289c19b37)]:
119 - @tanstack/db@0.5.31
120
121## 0.1.74
122
123### Patch Changes
124
125- Updated dependencies [[`e9d0fd8`](https://github.com/TanStack/db/commit/e9d0fd8f0db18a7dc8a0f2b3eacd50a94f6258f7)]:
126 - @tanstack/db@0.5.30
127
128## 0.1.73
129
130### Patch Changes
131
132- Updated dependencies [[`77b815e`](https://github.com/TanStack/db/commit/77b815ee52e91ca8d03110a551a4cb8bab4f2daa), [`ac4ce67`](https://github.com/TanStack/db/commit/ac4ce6790e906f5cfb086b063c8d7daa7681ceb9)]:
133 - @tanstack/db@0.5.29
134
135## 0.1.72
136
137### Patch Changes
138
139- Updated dependencies [[`46450e7`](https://github.com/TanStack/db/commit/46450e73bf78dbdcbef1fb46cb90c6a86b10f6c8)]:
140 - @tanstack/db@0.5.28
141
142## 0.1.71
143
144### Patch Changes
145
146- Updated dependencies [[`802550f`](https://github.com/TanStack/db/commit/802550f3c517b8decac273edf9a4a6074fb3526b), [`dc41d7d`](https://github.com/TanStack/db/commit/dc41d7dacc4a70cb62462633a375de823f01b280), [`4ff3da5`](https://github.com/TanStack/db/commit/4ff3da57e095dc17d8585585d7678b9538cf7602), [`2223cd6`](https://github.com/TanStack/db/commit/2223cd6b51ce37f21983302804a75af28b47f2fe)]:
147 - @tanstack/db@0.5.27
148
149## 0.1.70
150
151### Patch Changes
152
153- Fix `useLiveInfiniteQuery` peek-ahead detection for `hasNextPage`. The initial query now correctly requests `pageSize + 1` items to detect whether additional pages exist, matching the behavior of subsequent page loads. ([#1209](https://github.com/TanStack/db/pull/1209))
154
155 Fix async on-demand pagination by ensuring the graph callback fires at least once even when there is no pending graph work, so that `loadMoreIfNeeded` is triggered after `setWindow()` increases the limit.
156
157- Updated dependencies [[`85c373e`](https://github.com/TanStack/db/commit/85c373ef892e4080fe86b26e2fcb762181545e3c), [`9184dcc`](https://github.com/TanStack/db/commit/9184dcce62019ea870f968f4a4a5c2428291214d), [`83d5ac8`](https://github.com/TanStack/db/commit/83d5ac82983fb6c244c53d349c83845969473a9b)]:
158 - @tanstack/db@0.5.26
159
160## 0.1.69
161
162### Patch Changes
163
164- Updated dependencies [[`43c7c9d`](https://github.com/TanStack/db/commit/43c7c9d5f2b47366a58f87470ac5dca95020ac57), [`284ebcc`](https://github.com/TanStack/db/commit/284ebcc8346bd237c3381de766995b8bda35009a)]:
165 - @tanstack/db@0.5.25
166
167## 0.1.68
168
169### Patch Changes
170
171- Updated dependencies [[`7099459`](https://github.com/TanStack/db/commit/7099459291810b237a9fb24bbfe6e543852a2ab2)]:
172 - @tanstack/db@0.5.24
173
174## 0.1.67
175
176### Patch Changes
177
178- Updated dependencies [[`05130f2`](https://github.com/TanStack/db/commit/05130f2420eb682f11f099310a0af87afa3f35fe)]:
179 - @tanstack/db@0.5.23
180
181## 0.1.66
182
183### Patch Changes
184
185- Updated dependencies [[`f9b741e`](https://github.com/TanStack/db/commit/f9b741e9fb636be1c9f1502b7e28fe691bae2480)]:
186 - @tanstack/db@0.5.22
187
188## 0.1.65
189
190### Patch Changes
191
192- Updated dependencies [[`6745ed0`](https://github.com/TanStack/db/commit/6745ed003dc25cfd6fa0f7e60f708205a6069ff2), [`1b22e40`](https://github.com/TanStack/db/commit/1b22e40c56323cfa5e7f759272fed53320aa32f7), [`7a2cacd`](https://github.com/TanStack/db/commit/7a2cacd7a426530cb77844a8c2680f6b06e9ce2f), [`bdf9405`](https://github.com/TanStack/db/commit/bdf94059e7ab98b5181e0df7d8d25cd1dbb5ae58)]:
193 - @tanstack/db@0.5.21
194
195## 0.1.64
196
197### Patch Changes
198
199- Updated dependencies []:
200 - @tanstack/db@0.5.20
201
202## 0.1.63
203
204### Patch Changes
205
206- Updated dependencies [[`29033b8`](https://github.com/TanStack/db/commit/29033b8f55b0ba5721371ad761037ec813440aa7), [`888ad6a`](https://github.com/TanStack/db/commit/888ad6afe5932b0467320c04fbd4583469cb9c47)]:
207 - @tanstack/db@0.5.19
208
209## 0.1.62
210
211### Patch Changes
212
213- Updated dependencies [[`c1247e8`](https://github.com/TanStack/db/commit/c1247e816950314da6d201613481577834c1d97a)]:
214 - @tanstack/db@0.5.18
215
216## 0.1.61
217
218### Patch Changes
219
220- Improve runtime error message and documentation when `useLiveSuspenseQuery` receives `undefined` from query callback. ([#860](https://github.com/TanStack/db/pull/860))
221
222 Following TanStack Query's `useSuspenseQuery` design, `useLiveSuspenseQuery` intentionally does not support disabled queries (when callback returns `undefined` or `null`). This maintains the type guarantee that `data` is always `T` (not `T | undefined`), which is a core benefit of using Suspense.
223
224 **What changed:**
225 1. **Improved runtime error message** with clear guidance:
226
227 ```
228 useLiveSuspenseQuery does not support disabled queries (callback returned undefined/null).
229 The Suspense pattern requires data to always be defined (T, not T | undefined).
230 Solutions:
231 1) Use conditional rendering - don't render the component until the condition is met.
232 2) Use useLiveQuery instead, which supports disabled queries with the 'isEnabled' flag.
233 ```
234
235 2. **Enhanced JSDoc documentation** with detailed `@remarks` section explaining the design decision, showing both incorrect (❌) and correct (✅) patterns
236
237 **Why this matters:**
238
239 ```typescript
240 // ❌ This pattern doesn't work with Suspense queries:
241 const { data } = useLiveSuspenseQuery(
242 (q) => userId
243 ? q.from({ users }).where(({ users }) => eq(users.id, userId)).findOne()
244 : undefined,
245 [userId]
246 )
247
248 // ✅ Instead, use conditional rendering:
249 function UserProfile({ userId }: { userId: string }) {
250 const { data } = useLiveSuspenseQuery(
251 (q) => q.from({ users }).where(({ users }) => eq(users.id, userId)).findOne(),
252 [userId]
253 )
254 return <div>{data.name}</div> // data is guaranteed non-undefined
255 }
256
257 function App({ userId }: { userId?: string }) {
258 if (!userId) return <div>No user selected</div>
259 return <UserProfile userId={userId} />
260 }
261
262 // ✅ Or use useLiveQuery for conditional queries:
263 const { data, isEnabled } = useLiveQuery(
264 (q) => userId
265 ? q.from({ users }).where(({ users }) => eq(users.id, userId)).findOne()
266 : undefined,
267 [userId]
268 )
269 ```
270
271 This aligns with TanStack Query's philosophy where Suspense queries prioritize type safety and proper component composition over flexibility.
272
273- Updated dependencies [[`f795a67`](https://github.com/TanStack/db/commit/f795a674f21659ef46ff370d4f3b9903a596bcaf), [`d542667`](https://github.com/TanStack/db/commit/d542667a3440415d8e6cbb449b20abd3cbd6855c), [`6503c09`](https://github.com/TanStack/db/commit/6503c091a259208331f471dca29abf086e881147), [`b1cc4a7`](https://github.com/TanStack/db/commit/b1cc4a7e018ffb6804ae7f1c99e9c6eb4bb22812)]:
274 - @tanstack/db@0.5.17
275
276## 0.1.60
277
278### Patch Changes
279
280- Updated dependencies [[`41308b8`](https://github.com/TanStack/db/commit/41308b8ee914aa467e22842cd454f06d1a60032e)]:
281 - @tanstack/db@0.5.16
282
283## 0.1.59
284
285### Patch Changes
286
287- Updated dependencies [[`32ec4d8`](https://github.com/TanStack/db/commit/32ec4d8478cca96f76f3a49efc259c95b85baa40)]:
288 - @tanstack/db@0.5.15
289
290## 0.1.58
291
292### Patch Changes
293
294- Updated dependencies [[`26ed0aa`](https://github.com/TanStack/db/commit/26ed0aad2def60e652508a99b2e980e73f70148e)]:
295 - @tanstack/db@0.5.14
296
297## 0.1.57
298
299### Patch Changes
300
301- Updated dependencies [[`8ed7725`](https://github.com/TanStack/db/commit/8ed7725514a6a501482a391162f7792aa8b371e5), [`01452bf`](https://github.com/TanStack/db/commit/01452bfd0d00da8bd52941a4954af73749473651)]:
302 - @tanstack/db@0.5.13
303
304## 0.1.56
305
306### Patch Changes
307
308- Updated dependencies [[`b3b1940`](https://github.com/TanStack/db/commit/b3b194000d8efcc2c6cc45a663029dadc26f13f0), [`09da081`](https://github.com/TanStack/db/commit/09da081b420fc915d7f0dc566c6cdbbc78582435), [`86ad40c`](https://github.com/TanStack/db/commit/86ad40c6bc37b2f5d4ad24d06f72168ca4b96161)]:
309 - @tanstack/db@0.5.12
310
311## 0.1.55
312
313### Patch Changes
314
315- Fixed `isReady` to return `true` for disabled queries in `useLiveQuery`/`injectLiveQuery` across all framework packages. When a query function returns `null` or `undefined` (disabling the query), there's no async operation to wait for, so the hook should be considered "ready" immediately. ([#886](https://github.com/TanStack/db/pull/886))
316
317 Additionally, all frameworks now have proper TypeScript overloads that explicitly support returning `undefined | null` from query functions, making the disabled query pattern type-safe.
318
319 This fixes the common pattern where users conditionally enable queries and don't want to show loading states when the query is disabled.
320
321- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]:
322 - @tanstack/db@0.5.11
323
324## 0.1.54
325
326### Patch Changes
327
328- Updated dependencies [[`1d19d22`](https://github.com/TanStack/db/commit/1d19d2219cbbaef6483845df1c3b078077e4e3bd), [`b3e4e80`](https://github.com/TanStack/db/commit/b3e4e80c4b73d96c15391ac25efb518c7ae7ccbb)]:
329 - @tanstack/db@0.5.10
330
331## 0.1.53
332
333### Patch Changes
334
335- Updated dependencies [[`5f474f1`](https://github.com/TanStack/db/commit/5f474f1eabd57e144ba05b0f33d848f7efc8fb07)]:
336 - @tanstack/db@0.5.9
337
338## 0.1.52
339
340### Patch Changes
341
342- Updated dependencies [[`954c8fe`](https://github.com/TanStack/db/commit/954c8fed5ed92a348ac8b6d8333bc69c955f4f60), [`51c73aa`](https://github.com/TanStack/db/commit/51c73aaa2b27b27966edb98fb6664beb44eac1ac)]:
343 - @tanstack/db@0.5.8
344
345## 0.1.51
346
347### Patch Changes
348
349- Updated dependencies [[`295cb45`](https://github.com/TanStack/db/commit/295cb45797572b232650eddd3d62ffa937fa2fd7)]:
350 - @tanstack/db@0.5.7
351
352## 0.1.50
353
354### Patch Changes
355
356- Updated dependencies [[`c8a2c16`](https://github.com/TanStack/db/commit/c8a2c16aa528427d5ddd55cda4ee59a5cb369b5f)]:
357 - @tanstack/db@0.5.6
358
359## 0.1.49
360
361### Patch Changes
362
363- Updated dependencies [[`077fc1a`](https://github.com/TanStack/db/commit/077fc1a418ca090d7533115888c09f3f609e36b2)]:
364 - @tanstack/db@0.5.5
365
366## 0.1.48
367
368### Patch Changes
369
370- Updated dependencies [[`acb3e4f`](https://github.com/TanStack/db/commit/acb3e4f1441e6872ca577e74d92ae2d77deb5938), [`464805d`](https://github.com/TanStack/db/commit/464805d96bad6d0fd741e48fbfc98e90dc58bebe), [`2c2e4db`](https://github.com/TanStack/db/commit/2c2e4dbd781d278347d73373f66d3c51c6388116), [`15c772f`](https://github.com/TanStack/db/commit/15c772f5e42e49000a2d775fd8e4cfda3418243f)]:
371 - @tanstack/db@0.5.4
372
373## 0.1.47
374
375### Patch Changes
376
377- Updated dependencies [[`846a830`](https://github.com/TanStack/db/commit/846a8309a243197245f4400a5d53cef5cec6d5d9), [`8e26dcf`](https://github.com/TanStack/db/commit/8e26dcfde600e4a18cd51fbe524560d60ab98d70)]:
378 - @tanstack/db@0.5.3
379
380## 0.1.46
381
382### Patch Changes
383
384- Updated dependencies [[`99a3716`](https://github.com/TanStack/db/commit/99a371630b9f4632db86c43357c64701ecb53b0e)]:
385 - @tanstack/db@0.5.2
386
387## 0.1.45
388
389### Patch Changes
390
391- Updated dependencies [[`a83a818`](https://github.com/TanStack/db/commit/a83a8189514d22ca2fcdf34b9cb97206d3c03c38)]:
392 - @tanstack/db@0.5.1
393
394## 0.1.44
395
396### Patch Changes
397
398- Updated dependencies [[`243a35a`](https://github.com/TanStack/db/commit/243a35a632ee0aca20c3ee12ee2ac2929d8be11d), [`f9d11fc`](https://github.com/TanStack/db/commit/f9d11fc3d7297c61feb3c6876cb2f436edbb5b34), [`7aedf12`](https://github.com/TanStack/db/commit/7aedf12996a67ef64010bca0d78d51c919dd384f), [`28f81b5`](https://github.com/TanStack/db/commit/28f81b5165d0a9566f99c2b6cf0ad09533e1a2cb), [`28f81b5`](https://github.com/TanStack/db/commit/28f81b5165d0a9566f99c2b6cf0ad09533e1a2cb), [`f6ac7ea`](https://github.com/TanStack/db/commit/f6ac7eac50ae1334ddb173786a68c9fc732848f9), [`01093a7`](https://github.com/TanStack/db/commit/01093a762cf2f5f308edec7f466d1c3dabb5ea9f)]:
399 - @tanstack/db@0.5.0
400
401## 0.1.43
402
403### Patch Changes
404
405- Updated dependencies [[`6c55e16`](https://github.com/TanStack/db/commit/6c55e16a2545b479b1d47f548b6846d362573d45), [`7805afb`](https://github.com/TanStack/db/commit/7805afb7286b680168b336e77dd4de7dd1b6f06a), [`1367756`](https://github.com/TanStack/db/commit/1367756d0a68447405c5f5c1a3cca30ab0558d74)]:
406 - @tanstack/db@0.4.20
407
408## 0.1.42
409
410### Patch Changes
411
412- Updated dependencies [[`75470a8`](https://github.com/TanStack/db/commit/75470a8297f316b4817601b2ea92cb9b21cc7829)]:
413 - @tanstack/db@0.4.19
414
415## 0.1.41
416
417### Patch Changes
418
419- Add `useLiveSuspenseQuery` hook for React Suspense support ([#697](https://github.com/TanStack/db/pull/697))
420
421 Introduces a new `useLiveSuspenseQuery` hook that integrates with React Suspense and Error Boundaries, following TanStack Query's `useSuspenseQuery` pattern.
422
423 **Key features:**
424 - React 18+ compatible using the throw promise pattern
425 - Type-safe API with guaranteed data (never undefined)
426 - Automatic error handling via Error Boundaries
427 - Reactive updates after initial load via useSyncExternalStore
428 - Support for dependency-based re-suspension
429 - Works with query functions, config objects, and pre-created collections
430
431 **Example usage:**
432
433 ```tsx
434 import { Suspense } from 'react'
435 import { useLiveSuspenseQuery } from '@tanstack/react-db'
436
437 function TodoList() {
438 // Data is guaranteed to be defined - no isLoading needed
439 const { data } = useLiveSuspenseQuery((q) =>
440 q
441 .from({ todos: todosCollection })
442 .where(({ todos }) => eq(todos.completed, false)),
443 )
444
445 return (
446 <ul>
447 {data.map((todo) => (
448 <li key={todo.id}>{todo.text}</li>
449 ))}
450 </ul>
451 )
452 }
453
454 function App() {
455 return (
456 <Suspense fallback={<div>Loading...</div>}>
457 <TodoList />
458 </Suspense>
459 )
460 }
461 ```
462
463 **Implementation details:**
464 - Throws promises when collection is loading (caught by Suspense)
465 - Throws errors when collection fails (caught by Error Boundary)
466 - Reuses promise across re-renders to prevent infinite loops
467 - Detects dependency changes and creates new collection/promise
468 - Same TypeScript overloads as useLiveQuery for consistency
469
470 **Documentation:**
471 - Comprehensive guide in live-queries.md covering usage patterns and when to use each hook
472 - Comparison with useLiveQuery showing different approaches to loading/error states
473 - Router loader pattern recommendation for React Router/TanStack Router users
474 - Error handling examples with Suspense and Error Boundaries
475
476 Resolves #692
477
478## 0.1.40
479
480### Patch Changes
481
482- Updated dependencies [[`f416231`](https://github.com/TanStack/db/commit/f41623180c862b58b4fa6415383dfdb034f84ee9), [`b1b8299`](https://github.com/TanStack/db/commit/b1b82994cb9765225129b5a19be06e9369e3158d)]:
483 - @tanstack/db@0.4.18
484
485## 0.1.39
486
487### Patch Changes
488
489- Updated dependencies [[`49bcaa5`](https://github.com/TanStack/db/commit/49bcaa5557ba8d647c947811ed6e0c2450159d84)]:
490 - @tanstack/db@0.4.17
491
492## 0.1.38
493
494### Patch Changes
495
496- Add paced mutations with pluggable timing strategies ([#704](https://github.com/TanStack/db/pull/704))
497
498 Introduces a new paced mutations system that enables optimistic mutations with pluggable timing strategies. This provides fine-grained control over when and how mutations are persisted to the backend. Powered by [TanStack Pacer](https://github.com/TanStack/pacer).
499
500 **Key Design:**
501 - **Debounce/Throttle**: Only one pending transaction (collecting mutations) and one persisting transaction (writing to backend) at a time. Multiple rapid mutations automatically merge together.
502 - **Queue**: Each mutation creates a separate transaction, guaranteed to run in the order they're made (FIFO by default, configurable to LIFO).
503
504 **Core Features:**
505 - **Pluggable Strategy System**: Choose from debounce, queue, or throttle strategies to control mutation timing
506 - **Auto-merging Mutations**: Multiple rapid mutations on the same item automatically merge for efficiency (debounce/throttle only)
507 - **Transaction Management**: Full transaction lifecycle tracking (pending → persisting → completed/failed)
508 - **React Hook**: `usePacedMutations` for easy integration in React applications
509
510 **Available Strategies:**
511 - `debounceStrategy`: Wait for inactivity before persisting. Only final state is saved. (ideal for auto-save, search-as-you-type)
512 - `queueStrategy`: Each mutation becomes a separate transaction, processed sequentially in order (defaults to FIFO, configurable to LIFO). All mutations are guaranteed to persist. (ideal for sequential workflows, rate-limited APIs)
513 - `throttleStrategy`: Ensure minimum spacing between executions. Mutations between executions are merged. (ideal for analytics, progress updates)
514
515 **Example Usage:**
516
517 ```ts
518 import { usePacedMutations, debounceStrategy } from '@tanstack/react-db'
519
520 const mutate = usePacedMutations({
521 mutationFn: async ({ transaction }) => {
522 await api.save(transaction.mutations)
523 },
524 strategy: debounceStrategy({ wait: 500 }),
525 })
526
527 // Trigger a mutation
528 const tx = mutate(() => {
529 collection.update(id, (draft) => {
530 draft.value = newValue
531 })
532 })
533
534 // Optionally await persistence
535 await tx.isPersisted.promise
536 ```
537
538- Updated dependencies [[`979a66f`](https://github.com/TanStack/db/commit/979a66f2f6eff0ffe44dfde7c67feea933ee6110), [`f8a979b`](https://github.com/TanStack/db/commit/f8a979ba3aa90ac7e85f7a065fc050bda6589b4b), [`cb25623`](https://github.com/TanStack/db/commit/cb256234c9cd8df7771808b147e5afc2be56f51f)]:
539 - @tanstack/db@0.4.16
540
541## 0.1.37
542
543### Patch Changes
544
545- Updated dependencies [[`6738247`](https://github.com/TanStack/db/commit/673824791bcfae04acf42fc35e5d6d8755adceb2)]:
546 - @tanstack/db@0.4.15
547
548## 0.1.36
549
550### Patch Changes
551
552- Updated dependencies [[`970616b`](https://github.com/TanStack/db/commit/970616b6db723d1716eecd5076417de5d6e9a884)]:
553 - @tanstack/db@0.4.14
554
555## 0.1.35
556
557### Patch Changes
558
559- Updated dependencies [[`3c9526c`](https://github.com/TanStack/db/commit/3c9526cd1fd80032ddddff32cf4a23dfa8376888)]:
560 - @tanstack/db@0.4.13
561
562## 0.1.34
563
564### Patch Changes
565
566- Updated dependencies [[`8b29841`](https://github.com/TanStack/db/commit/8b298417964340bbac5ad08a831766f8f1497477), [`8187c6d`](https://github.com/TanStack/db/commit/8187c6d69c4b498e306ac2eb5fc7115e4f8193a5)]:
567 - @tanstack/db@0.4.12
568
569## 0.1.33
570
571### Patch Changes
572
573- Add support for pre-created live query collections in useLiveInfiniteQuery, enabling router loader patterns where live queries can be created, preloaded, and passed to components. ([#684](https://github.com/TanStack/db/pull/684))
574
575- Updated dependencies [[`5566b26`](https://github.com/TanStack/db/commit/5566b26100abdae9b4a041f048aeda1dd726e904)]:
576 - @tanstack/db@0.4.11
577
578## 0.1.32
579
580### Patch Changes
581
582- Add `useLiveInfiniteQuery` hook for infinite scrolling with live updates. ([#669](https://github.com/TanStack/db/pull/669))
583
584 The new `useLiveInfiniteQuery` hook provides an infinite query pattern similar to TanStack Query's `useInfiniteQuery`, but with live updates from your local collection. It uses `liveQueryCollection.utils.setWindow()` internally to efficiently paginate through ordered data without recreating the query on each page fetch.
585
586 **Key features:**
587 - Automatic live updates as data changes in the collection
588 - Efficient pagination using dynamic window adjustment
589 - Peek-ahead mechanism to detect when more pages are available
590 - Compatible with TanStack Query's infinite query API patterns
591
592 **Example usage:**
593
594 ```tsx
595 import { useLiveInfiniteQuery } from '@tanstack/react-db'
596
597 function PostList() {
598 const { data, pages, fetchNextPage, hasNextPage, isLoading } =
599 useLiveInfiniteQuery(
600 (q) =>
601 q
602 .from({ posts: postsCollection })
603 .orderBy(({ posts }) => posts.createdAt, 'desc'),
604 {
605 pageSize: 20,
606 getNextPageParam: (lastPage, allPages) =>
607 lastPage.length === 20 ? allPages.length : undefined,
608 },
609 )
610
611 if (isLoading) return <div>Loading...</div>
612
613 return (
614 <div>
615 {pages.map((page, i) => (
616 <div key={i}>
617 {page.map((post) => (
618 <PostCard key={post.id} post={post} />
619 ))}
620 </div>
621 ))}
622 {hasNextPage && (
623 <button onClick={() => fetchNextPage()}>Load More</button>
624 )}
625 </div>
626 )
627 }
628 ```
629
630 **Requirements:**
631 - Query must include `.orderBy()` for the window mechanism to work
632 - Returns flattened `data` array and `pages` array for flexible rendering
633 - Automatically detects new pages when data is synced to the collection
634
635- Updated dependencies [[`63aa8ef`](https://github.com/TanStack/db/commit/63aa8ef8b09960ce0f93e068d41b37fb0503a21a), [`b0687ab`](https://github.com/TanStack/db/commit/b0687ab4c1476362d7a25e3c1704ab0fb0385455)]:
636 - @tanstack/db@0.4.10
637
638## 0.1.31
639
640### Patch Changes
641
642- Updated dependencies [[`e52be92`](https://github.com/TanStack/db/commit/e52be92ce16b09a095b4b9baf7ac2cf708146f47), [`4a7c44a`](https://github.com/TanStack/db/commit/4a7c44a723223ade4e226745eadffead671fff13), [`ee61bb6`](https://github.com/TanStack/db/commit/ee61bb61f76ca510f113e96baa090940719aac40)]:
643 - @tanstack/db@0.4.9
644
645## 0.1.30
646
647### Patch Changes
648
649- Refactored live queries to execute eagerly during sync. Live queries now materialize their results immediately as data arrives from source collections, even while those collections are still in a "loading" state, rather than waiting for all sources to be "ready" before executing. ([#658](https://github.com/TanStack/db/pull/658))
650
651- Updated dependencies [[`d9ae7b7`](https://github.com/TanStack/db/commit/d9ae7b76b8ab30fd55fe835531974eee333dd450), [`44555b7`](https://github.com/TanStack/db/commit/44555b733a1a4d38d8126bf8da51d4b44f898298)]:
652 - @tanstack/db@0.4.8
653
654## 0.1.29
655
656### Patch Changes
657
658- Updated dependencies [[`6692aad`](https://github.com/TanStack/db/commit/6692aad4267e127b71ce595529080d6fc0aa2066)]:
659 - @tanstack/db@0.4.7
660
661## 0.1.28
662
663### Patch Changes
664
665- Updated dependencies [[`dd6cdf7`](https://github.com/TanStack/db/commit/dd6cdf7ea62d91bfb12ea8d25bdd25549259c113), [`c30a20b`](https://github.com/TanStack/db/commit/c30a20b1df39b34f18d0aa7c7b901a27fb963f36)]:
666 - @tanstack/db@0.4.6
667
668## 0.1.27
669
670### Patch Changes
671
672- Updated dependencies [[`7556fb6`](https://github.com/TanStack/db/commit/7556fb6f888b5bdc830fe6448eb3368efeb61988)]:
673 - @tanstack/db@0.4.5
674
675## 0.1.26
676
677### Patch Changes
678
679- Updated dependencies [[`56b870b`](https://github.com/TanStack/db/commit/56b870b3e63f8010b6eeebea87893b10c75a5888), [`f623990`](https://github.com/TanStack/db/commit/f62399062e4db61426ddfbbbe324c48cab2513dd), [`5f43d5f`](https://github.com/TanStack/db/commit/5f43d5f7f47614be8e71856ceb0f91733d9be627), [`05776f5`](https://github.com/TanStack/db/commit/05776f52a8ce4fe41b34fc8cace2046afc42835c), [`d27d32a`](https://github.com/TanStack/db/commit/d27d32aceb7f8fcabc07dcf1b55a84a605d2f23f)]:
680 - @tanstack/db@0.4.4
681
682## 0.1.25
683
684### Patch Changes
685
686- Updated dependencies [[`32f2212`](https://github.com/TanStack/db/commit/32f221278e2a684f3f4e1e2ace1ca98f5ecc858a)]:
687 - @tanstack/db@0.4.3
688
689## 0.1.24
690
691### Patch Changes
692
693- Updated dependencies [[`51c6bc5`](https://github.com/TanStack/db/commit/51c6bc58244ed6a3ac853e7e6af7775b33d6b65a), [`248e2c6`](https://github.com/TanStack/db/commit/248e2c6db8e9df8cf2cb225100e4ba9cb67cd534), [`ce7e2b2`](https://github.com/TanStack/db/commit/ce7e2b209ed882baa29ec86f89f1b527d6580e0b), [`1b832ff`](https://github.com/TanStack/db/commit/1b832ff9ec236e7dbe9256803e2ba12b4c9b9a30)]:
694 - @tanstack/db@0.4.2
695
696## 0.1.23
697
698### Patch Changes
699
700- Updated dependencies [[`8cd0876`](https://github.com/TanStack/db/commit/8cd0876b50bc7c1a614365318d5e74c2f32a0f80)]:
701 - @tanstack/db@0.4.1
702
703## 0.1.22
704
705### Patch Changes
706
707- Let collection.subscribeChanges return a subscription object. Move all data loading code related to optimizations into that subscription object. ([#564](https://github.com/TanStack/db/pull/564))
708
709- Updated dependencies [[`2f87216`](https://github.com/TanStack/db/commit/2f8721630e06331ca8bb2f962fbb283341103a58), [`ac6250a`](https://github.com/TanStack/db/commit/ac6250a879e95718e8d911732c10fb3388569f0f), [`2f87216`](https://github.com/TanStack/db/commit/2f8721630e06331ca8bb2f962fbb283341103a58)]:
710 - @tanstack/db@0.4.0
711
712## 0.1.21
713
714### Patch Changes
715
716- Expand `useLiveQuery` callback to support conditional queries and additional return types, enabling the ability to temporarily disable the query. ([#535](https://github.com/TanStack/db/pull/535))
717
718 **New Features:**
719 - Callback can now return `undefined` or `null` to temporarily disable the query
720 - Callback can return a pre-created `Collection` instance to use it directly
721 - Callback can return a `LiveQueryCollectionConfig` object for advanced configuration
722 - When disabled (returning `undefined`/`null`), the hook returns a specific idle state
723
724 **Usage Examples:**
725
726 ```ts
727 // Conditional queries - disable when not ready
728 const enabled = useState(false)
729 const { data, state, isIdle } = useLiveQuery((q) => {
730 if (!enabled) return undefined // Disables the query
731 return q.from({ users }).where(...)
732 }, [enabled])
733
734 /**
735 * When disabled, returns:
736 * {
737 * state: undefined,
738 * data: undefined,
739 * isIdle: true,
740 * ...
741 * }
742 */
743
744 // Return pre-created Collection
745 const { data } = useLiveQuery((q) => {
746 if (usePrebuilt) return myCollection // Use existing collection
747 return q.from({ items }).select(...)
748 }, [usePrebuilt])
749
750 // Return LiveQueryCollectionConfig
751 const { data } = useLiveQuery((q) => {
752 return {
753 query: q.from({ items }).select(...),
754 id: `my-collection`,
755 }
756 })
757 ```
758
759- Updated dependencies [[`cacfca2`](https://github.com/TanStack/db/commit/cacfca2d1b430c34a05202128fd3affa4bff54d6)]:
760 - @tanstack/db@0.3.2
761
762## 0.1.20
763
764### Patch Changes
765
766- Updated dependencies [[`5f51f35`](https://github.com/TanStack/db/commit/5f51f35d2c9543766a00cc5eea1374c62798b34e)]:
767 - @tanstack/db@0.3.1
768
769## 0.1.19
770
771### Patch Changes
772
773- Updated dependencies [[`c557a14`](https://github.com/TanStack/db/commit/c557a1488650ea9081b671a4ac278d55c59ac9cc), [`b5c87f7`](https://github.com/TanStack/db/commit/b5c87f71dbb534e4f1c660cf010e2cb6c0446ec5)]:
774 - @tanstack/db@0.3.0
775
776## 0.1.18
777
778### Patch Changes
779
780- Updated dependencies [[`b03894d`](https://github.com/TanStack/db/commit/b03894db05e063629a3660e03b31a80a48558dd5), [`3968087`](https://github.com/TanStack/db/commit/39680877fdc1993733933d2def13217bd18fa254)]:
781 - @tanstack/db@0.2.5
782
783## 0.1.17
784
785### Patch Changes
786
787- Updated dependencies [[`92febbf`](https://github.com/TanStack/db/commit/92febbf1feaa1d46f8cc4d7a4ea0d44cd5f85256), [`b487430`](https://github.com/TanStack/db/commit/b4874308813f95232f3361de539cec104ed55170)]:
788 - @tanstack/db@0.2.4
789
790## 0.1.16
791
792### Patch Changes
793
794- Updated dependencies [[`b162556`](https://github.com/TanStack/db/commit/b1625565df44b0824501297f7ef14ae1cd450b49)]:
795 - @tanstack/db@0.2.3
796
797## 0.1.15
798
799### Patch Changes
800
801- Updated dependencies [[`33515c6`](https://github.com/TanStack/db/commit/33515c69befc557add2cf828354ee378100f3977)]:
802 - @tanstack/db@0.2.2
803
804## 0.1.14
805
806### Patch Changes
807
808- Updated dependencies [[`620ebea`](https://github.com/TanStack/db/commit/620ebea96eb3fbeec66701b949de9920c4084c17)]:
809 - @tanstack/db@0.2.1
810
811## 0.1.13
812
813### Patch Changes
814
815- Updated dependencies [[`08303e6`](https://github.com/TanStack/db/commit/08303e645974db97e10b2aca0031abcbce027dd6), [`bafeaa1`](https://github.com/TanStack/db/commit/bafeaa1e9f161ac2200ce86537e442b2aa8e2a5b), [`1814f8c`](https://github.com/TanStack/db/commit/1814f8cc3c0e831c82f8053b86fbbbd737e4f34b), [`31acdf2`](https://github.com/TanStack/db/commit/31acdf2a96411da327f93f0d30fa78d884422969), [`e41ed7e`](https://github.com/TanStack/db/commit/e41ed7e1ff1d94dd3ce0c48b6321f66b8ea044fd), [`51954d8`](https://github.com/TanStack/db/commit/51954d8c5d64291d136159bce293e0ad00a19f88)]:
816 - @tanstack/db@0.2.0
817
818## 0.1.12
819
820### Patch Changes
821
822- Updated dependencies [[`cc4c34a`](https://github.com/TanStack/db/commit/cc4c34a6b40c81c83aa10c8d00dfc0a3d33c56db)]:
823 - @tanstack/db@0.1.12
824
825## 0.1.11
826
827### Patch Changes
828
829- Fixed a bug where a race condition could cause initial results not to be rendered when using `useLiveQuery`. ([#485](https://github.com/TanStack/db/pull/485))
830
831- Updated dependencies [[`b869f68`](https://github.com/TanStack/db/commit/b869f68f0109b3126509f202a38855cee38b4276)]:
832 - @tanstack/db@0.1.11
833
834## 0.1.10
835
836### Patch Changes
837
838- Updated dependencies [[`eb8fd18`](https://github.com/TanStack/db/commit/eb8fd18c50ee03b72cb06e4d7ef25f214367950b), [`e59a355`](https://github.com/TanStack/db/commit/e59a3551e75bac9dd166e14c911d9491e3a67b9a), [`074aab0`](https://github.com/TanStack/db/commit/074aab0477a7c55e9e0f19a705b96ed2619e2afb), [`d469c39`](https://github.com/TanStack/db/commit/d469c39a7bdc034fa4fbc533010573b3515f239f)]:
839 - @tanstack/db@0.1.10
840
841## 0.1.9
842
843### Patch Changes
844
845- Updated dependencies [[`d64b4a8`](https://github.com/TanStack/db/commit/d64b4a8b692a213c7ad58faaf66f5f5fd50bef66)]:
846 - @tanstack/db@0.1.9
847
848## 0.1.8
849
850### Patch Changes
851
852- Updated dependencies [[`1c5e206`](https://github.com/TanStack/db/commit/1c5e206d00d0a99f8419f0d00429b5a3c6cdc76e), [`4d20004`](https://github.com/TanStack/db/commit/4d2000488b9b5abf85c05801633297528af0eff6), [`968602e`](https://github.com/TanStack/db/commit/968602e4ffc597eaa559219daf22d6ef6321162a)]:
853 - @tanstack/db@0.1.8
854
855## 0.1.7
856
857### Patch Changes
858
859- Updated dependencies [[`48d0889`](https://github.com/TanStack/db/commit/48d088996a3f18df026aa7d2d1e7f27d1151345b), [`aecbcc3`](https://github.com/TanStack/db/commit/aecbcc32012561f1645df0bdf89a6c259058d888), [`a937f4c`](https://github.com/TanStack/db/commit/a937f4c7a5f4fc20c255e86692c5e2e80d5ebbec), [`3d60fad`](https://github.com/TanStack/db/commit/3d60fadbb9e8a1b62a9bcde947e282d653a2a270), [`79c95a3`](https://github.com/TanStack/db/commit/79c95a36f60087ffc3f9a02b76975c8bdf40acc7)]:
860 - @tanstack/db@0.1.7
861
862## 0.1.6
863
864### Patch Changes
865
866- Updated dependencies [[`ad33e9e`](https://github.com/TanStack/db/commit/ad33e9e535ca6197c2e00e2dbb59bf8e8f9bb51e)]:
867 - @tanstack/db@0.1.6
868
869## 0.1.5
870
871### Patch Changes
872
873- ensure that useLiveQuery returns a stable ref when there are no changes ([#388](https://github.com/TanStack/db/pull/388))
874
875- Updated dependencies [[`9a5a20c`](https://github.com/TanStack/db/commit/9a5a20c21fbf8286ab90e1db6d6f3315f8344a4e)]:
876 - @tanstack/db@0.1.5
877
878## 0.1.4
879
880### Patch Changes
881
882- Ensure that the ready status is correctly returned from a live query ([#390](https://github.com/TanStack/db/pull/390))
883
884- Updated dependencies [[`c90b4d8`](https://github.com/TanStack/db/commit/c90b4d85822f94f7fe72286d5c7ee07b087d0e20), [`6c1c19c`](https://github.com/TanStack/db/commit/6c1c19cedbc1d9d98396948e8e43fa0515bb8919), [`69a6d2d`](https://github.com/TanStack/db/commit/69a6d2d94c7a5510568c8b652356c62bd2b3cc76), [`6250a92`](https://github.com/TanStack/db/commit/6250a92c8045ef2fd69c107a94e05179471681d7), [`68538b4`](https://github.com/TanStack/db/commit/68538b4c446abeb992e24964f811c8900749f141)]:
885 - @tanstack/db@0.1.4
886
887## 0.1.3
888
889### Patch Changes
890
891- Updated dependencies [[`0cb7699`](https://github.com/TanStack/db/commit/0cb76999e5d6df5916694a5afeb31b928eab68e4)]:
892 - @tanstack/db@0.1.3
893
894## 0.1.2
895
896### Patch Changes
897
898- Updated dependencies [[`bb5d50e`](https://github.com/TanStack/db/commit/bb5d50e255d9114ef32b8f52eef6b15399255327), [`97b595e`](https://github.com/TanStack/db/commit/97b595e9617b1abb05c14489e3d608b314da08e8)]:
899 - @tanstack/db@0.1.2
900
901## 0.1.1
902
903### Patch Changes
904
905- Updated dependencies [[`bc2f204`](https://github.com/TanStack/db/commit/bc2f204b8cb8a4870ade00757d10f846524e2090), [`bda3f24`](https://github.com/TanStack/db/commit/bda3f24cc41504f60be0c5e071698b7735f75e28)]:
906 - @tanstack/db@0.1.1
907
908## 0.1.0
909
910### Minor Changes
911
912- 0.1 release - first beta 🎉 ([#332](https://github.com/TanStack/db/pull/332))
913
914### Patch Changes
915
916- We have moved development of the differential dataflow implementation from @electric-sql/d2mini to a new @tanstack/db-ivm package inside the tanstack db monorepo to make development simpler. ([#330](https://github.com/TanStack/db/pull/330))
917
918- Updated dependencies [[`7d2f4be`](https://github.com/TanStack/db/commit/7d2f4be95c43aad29fb61e80e5a04c58c859322b), [`f0eda36`](https://github.com/TanStack/db/commit/f0eda36cb36350399bc8835686a6c4b6ad297e45)]:
919 - @tanstack/db@0.1.0
920
921## 0.0.33
922
923### Patch Changes
924
925- Updated dependencies [[`6e8d7f6`](https://github.com/TanStack/db/commit/6e8d7f660050118e050d575913733e469e3daa8c)]:
926 - @tanstack/db@0.0.33
927
928## 0.0.32
929
930### Patch Changes
931
932- Updated dependencies [[`e04bd12`](https://github.com/TanStack/db/commit/e04bd1252f612d4638104368d17cb644cc85295b)]:
933 - @tanstack/db@0.0.32
934
935## 0.0.31
936
937### Patch Changes
938
939- Updated dependencies [[`3e9a36d`](https://github.com/TanStack/db/commit/3e9a36d2600c4f700ca7bc4f720c189a5a29387a)]:
940 - @tanstack/db@0.0.31
941
942## 0.0.30
943
944### Patch Changes
945
946- Updated dependencies [[`6bdde55`](https://github.com/TanStack/db/commit/6bdde554f36f54c0c4f4dacb74bef5da45811855)]:
947 - @tanstack/db@0.0.30
948
949## 0.0.29
950
951### Patch Changes
952
953- Updated dependencies [[`ced0657`](https://github.com/TanStack/db/commit/ced0657e72646e35343dfea8389d96e213710cdf), [`dcfef51`](https://github.com/TanStack/db/commit/dcfef51d4d94c756bf77e40e7015e47b7982c09a), [`360b0df`](https://github.com/TanStack/db/commit/360b0dfa411ba9f8a93f6b737aa1df8fb37dd036), [`608be0c`](https://github.com/TanStack/db/commit/608be0c14dc5ae9577deebf436557a1eace46733), [`5260ee3`](https://github.com/TanStack/db/commit/5260ee3098d12eccc58a5cf903ea479908681402)]:
954 - @tanstack/db@0.0.29
955
956## 0.0.28
957
958### Patch Changes
959
960- Updated dependencies [[`bb85522`](https://github.com/TanStack/db/commit/bb8552210a97dd05d3ca6fdd080a3fd25c1023a6), [`e9e8e5e`](https://github.com/TanStack/db/commit/e9e8e5e20c23fb7f98865d6b8aab05ad5322e5f7)]:
961 - @tanstack/db@0.0.28
962
963## 0.0.27
964
965### Patch Changes
966
967- Updated dependencies [[`bec8620`](https://github.com/TanStack/db/commit/bec862004deef5fdd560f70107ebd59f7c27656e)]:
968 - @tanstack/db@0.0.27
969
970## 0.0.26
971
972### Patch Changes
973
974- Add initial release of TrailBase collection for TanStack DB. TrailBase is a blazingly fast, open-source alternative to Firebase built on Rust, SQLite, and V8. It provides type-safe REST and realtime APIs with sub-millisecond latencies, integrated authentication, and flexible access control - all in a single executable. This collection type enables seamless integration with TrailBase backends for high-performance real-time applications. ([#228](https://github.com/TanStack/db/pull/228))
975
976- Updated dependencies [[`09c6995`](https://github.com/TanStack/db/commit/09c6995ea9c8e6979d077ca63cbdd6215054ae78)]:
977 - @tanstack/db@0.0.26
978
979## 0.0.25
980
981### Patch Changes
982
983- Updated dependencies [[`1758eda`](https://github.com/TanStack/db/commit/1758edab9608383d9d1470156021ee632f043e51), [`20f810e`](https://github.com/TanStack/db/commit/20f810e13a7d802bf56da6f0df89b34312ebb2fd)]:
984 - @tanstack/db@0.0.25
985
986## 0.0.24
987
988### Patch Changes
989
990- Updated dependencies [[`11215d9`](https://github.com/TanStack/db/commit/11215d9544d02e9dc6258c661ba4b5e439e479ed), [`fe42591`](https://github.com/TanStack/db/commit/fe42591bd7ea9955d67ecec4471b44cb7808e74b), [`665efe6`](https://github.com/TanStack/db/commit/665efe660c1aed68139326a2a33904968622a882)]:
991 - @tanstack/db@0.0.24
992
993## 0.0.23
994
995### Patch Changes
996
997- Updated dependencies [[`056609e`](https://github.com/TanStack/db/commit/056609ed2926e12df5ee08be5fad0a6333e787f3)]:
998 - @tanstack/db@0.0.23
999
1000## 0.0.22
1001
1002### Patch Changes
1003
1004- Updated dependencies [[`aeee9a1`](https://github.com/TanStack/db/commit/aeee9a13411527bd0ebfc0a0c06989bdb904b650)]:
1005 - @tanstack/db@0.0.22
1006
1007## 0.0.21
1008
1009### Patch Changes
1010
1011- Updated dependencies [[`8e23322`](https://github.com/TanStack/db/commit/8e233229b25eabed07cdaf12948ba913786bf4f9)]:
1012 - @tanstack/db@0.0.21
1013
1014## 0.0.20
1015
1016### Patch Changes
1017
1018- Updated dependencies [[`f13c11e`](https://github.com/TanStack/db/commit/f13c11ed0ab27cd88b03d789b0cd953e86bd1333)]:
1019 - @tanstack/db@0.0.20
1020
1021## 0.0.19
1022
1023### Patch Changes
1024
1025- Updated dependencies [[`9f0b0c2`](https://github.com/TanStack/db/commit/9f0b0c28ede99273eb5914be28aff55b91c50778)]:
1026 - @tanstack/db@0.0.19
1027
1028## 0.0.18
1029
1030### Patch Changes
1031
1032- Improve jsdocs ([#243](https://github.com/TanStack/db/pull/243))
1033
1034- Updated dependencies [[`266bd29`](https://github.com/TanStack/db/commit/266bd29514c6c0fa9e903986ca11c5e22f4d2361)]:
1035 - @tanstack/db@0.0.18
1036
1037## 0.0.17
1038
1039### Patch Changes
1040
1041- Updated dependencies [[`7e63d76`](https://github.com/TanStack/db/commit/7e63d7671f9df9f9fc81240c3818789d4ed0d464)]:
1042 - @tanstack/db@0.0.17
1043
1044## 0.0.16
1045
1046### Patch Changes
1047
1048- add support for composable queries ([#232](https://github.com/TanStack/db/pull/232))
1049
1050- Updated dependencies [[`e478d53`](https://github.com/TanStack/db/commit/e478d5353cc8fc64e3a29dda1f86fba863cf6ce8)]:
1051 - @tanstack/db@0.0.16
1052
1053## 0.0.15
1054
1055### Patch Changes
1056
1057- Updated dependencies [[`f5cf44b`](https://github.com/TanStack/db/commit/f5cf44b1b181afef89a80cf7b8678337a3d4a065), [`f5cf44b`](https://github.com/TanStack/db/commit/f5cf44b1b181afef89a80cf7b8678337a3d4a065)]:
1058 - @tanstack/db@0.0.15
1059
1060## 0.0.14
1061
1062### Patch Changes
1063
1064- Updated dependencies [[`74c140d`](https://github.com/TanStack/db/commit/74c140d8744f1f7bd3f9cb940c75719574afc78f)]:
1065 - @tanstack/db@0.0.14
1066
1067## 0.0.13
1068
1069### Patch Changes
1070
1071- feat: implement Collection Lifecycle Management ([#198](https://github.com/TanStack/db/pull/198))
1072
1073 Adds automatic lifecycle management for collections to optimize resource usage.
1074
1075 **New Features:**
1076 - Added `startSync` option (defaults to `false`, set to `true` to start syncing immediately)
1077 - Automatic garbage collection after `gcTime` (default 5 minutes) of inactivity
1078 - Collection status tracking: "idle" | "loading" | "ready" | "error" | "cleaned-up"
1079 - Manual `preload()` and `cleanup()` methods for lifecycle control
1080
1081 **Usage:**
1082
1083 ```typescript
1084 const collection = createCollection({
1085 startSync: false, // Enable lazy loading
1086 gcTime: 300000, // Cleanup timeout (default: 5 minutes)
1087 })
1088
1089 console.log(collection.status) // Current state
1090 await collection.preload() // Ensure ready
1091 await collection.cleanup() // Manual cleanup
1092 ```
1093
1094- Add createOptimisticAction helper that replaces useOptimisticMutation ([#210](https://github.com/TanStack/db/pull/210))
1095
1096 An example of converting a `useOptimisticMutation` hook to `createOptimisticAction`. Now all optimistic & server mutation logic are consolidated.
1097
1098 ```diff
1099 -import { useOptimisticMutation } from '@tanstack/react-db'
1100 +import { createOptimisticAction } from '@tanstack/react-db'
1101 +
1102 +// Create the `addTodo` action, passing in your `mutationFn` and `onMutate`.
1103 +const addTodo = createOptimisticAction<string>({
1104 + onMutate: (text) => {
1105 + // Instantly applies the local optimistic state.
1106 + todoCollection.insert({
1107 + id: uuid(),
1108 + text,
1109 + completed: false
1110 + })
1111 + },
1112 + mutationFn: async (text) => {
1113 + // Persist the todo to your backend
1114 + const response = await fetch('/api/todos', {
1115 + method: 'POST',
1116 + body: JSON.stringify({ text, completed: false }),
1117 + })
1118 + return response.json()
1119 + }
1120 +})
1121
1122 const Todo = () => {
1123 - // Create the `addTodo` mutator, passing in your `mutationFn`.
1124 - const addTodo = useOptimisticMutation({ mutationFn })
1125 -
1126 const handleClick = () => {
1127 - // Triggers the mutationFn
1128 - addTodo.mutate(() =>
1129 - // Instantly applies the local optimistic state.
1130 - todoCollection.insert({
1131 - id: uuid(),
1132 - text: '🔥 Make app faster',
1133 - completed: false
1134 - })
1135 - )
1136 + // Triggers the onMutate and then the mutationFn
1137 + addTodo('🔥 Make app faster')
1138 }
1139
1140 return <Button onClick={ handleClick } />
1141 }
1142 ```
1143
1144- Updated dependencies [[`945868e`](https://github.com/TanStack/db/commit/945868e95944543ccf5d778409548679a952e249), [`0f8a008`](https://github.com/TanStack/db/commit/0f8a008be8b368f231c8518ad1adfcac08132da2), [`57b5f5d`](https://github.com/TanStack/db/commit/57b5f5de6297326a57ef205a400428af0697b48b)]:
1145 - @tanstack/db@0.0.13
1146
1147## 0.0.12
1148
1149### Patch Changes
1150
1151- Updated dependencies [[`f6abe9b`](https://github.com/TanStack/db/commit/f6abe9b94b890487fe960bd72a89e4a75de89d46)]:
1152 - @tanstack/db@0.0.12
1153
1154## 0.0.11
1155
1156### Patch Changes
1157
1158- Export `ElectricCollectionUtils` & allow passing generic to `createTransaction` ([#179](https://github.com/TanStack/db/pull/179))
1159
1160- Updated dependencies [[`66ed58b`](https://github.com/TanStack/db/commit/66ed58b66553683ff0a5241de8cde83954d18847), [`c5489ff`](https://github.com/TanStack/db/commit/c5489ff276db07a0a4b65876790ccd7f11a6f99d)]:
1161 - @tanstack/db@0.0.11
1162
1163## 0.0.10
1164
1165### Patch Changes
1166
1167- Updated dependencies [[`38d4505`](https://github.com/TanStack/db/commit/38d45051b065b619b95849f78422e9ace8750361)]:
1168 - @tanstack/db@0.0.10
1169
1170## 0.0.9
1171
1172### Patch Changes
1173
1174- Updated dependencies [[`2ae0b09`](https://github.com/TanStack/db/commit/2ae0b09cc52152b0044818b538e11e8ca10d0f80)]:
1175 - @tanstack/db@0.0.9
1176
1177## 0.0.8
1178
1179### Patch Changes
1180
1181- A large refactor of the core `Collection` with: ([#155](https://github.com/TanStack/db/pull/155))
1182 - a change to not use Store internally and emit fine grade changes with `subscribeChanges` and `subscribeKeyChanges` methods.
1183 - changes to the `Collection` api to be more `Map` like for reads, with `get`, `has`, `size`, `entries`, `keys`, and `values`.
1184 - renames `config.getId` to `config.getKey` for consistency with the `Map` like api.
1185
1186- Updated dependencies [[`5c538cf`](https://github.com/TanStack/db/commit/5c538cf03573512a8d1bbde96962a9f7ca014708), [`9553366`](https://github.com/TanStack/db/commit/955336604a286d7992f9506cb1c76ecf150d0432), [`b4602a0`](https://github.com/TanStack/db/commit/b4602a071cb6866bb1338e30d5802220b0d1fc49), [`02adc81`](https://github.com/TanStack/db/commit/02adc813177cbb44ab6245cc9821142e9cf97876), [`06d8ecc`](https://github.com/TanStack/db/commit/06d8eccc5aaabc194c31ea89c9b4191e2aa68180), [`c50cd51`](https://github.com/TanStack/db/commit/c50cd51ac8030b391cd9d84e8cd8b8fb57cb8ca5)]:
1187 - @tanstack/db@0.0.8
1188
1189## 0.0.7
1190
1191### Patch Changes
1192
1193- Expose utilities on collection instances ([#161](https://github.com/TanStack/db/pull/161))
1194
1195 Implemented a utility exposure pattern for TanStack DB collections that allows utility functions to be passed as part of collection options and exposes them under a `.utils` namespace, with full TypeScript typing.
1196 - Refactored `createCollection` in packages/db/src/collection.ts to accept options with utilities directly
1197 - Added `utils` property to CollectionImpl
1198 - Added TypeScript types for utility functions and utility records
1199 - Changed Collection from a class to a type, updating all usages to use createCollection() instead
1200 - Updated Electric/Query implementations
1201 - Utilities are now ergonomically accessible under `.utils`
1202 - Full TypeScript typing is preserved for both collection data and utilities
1203 - API is clean and straightforward - users can call `createCollection(optionsCreator(config))` directly
1204 - Zero-boilerplate TypeScript pattern that infers utility types automatically
1205
1206- Updated dependencies [[`8b43ad3`](https://github.com/TanStack/db/commit/8b43ad305b277560aed660c31cf1409d22ed1e47)]:
1207 - @tanstack/db@0.0.7
1208
1209## 0.0.6
1210
1211### Patch Changes
1212
1213- Updated dependencies [[`856be72`](https://github.com/TanStack/db/commit/856be725a6299374a3a97c88b50bd5d7bb94b783), [`0455e27`](https://github.com/TanStack/db/commit/0455e27f50d69b1e1887b841dc2f262f4de4c55d), [`80fdac7`](https://github.com/TanStack/db/commit/80fdac76389ea741f5743bc788df375f63fb767b)]:
1214 - @tanstack/db@0.0.6
1215
1216## 0.0.5
1217
1218### Patch Changes
1219
1220- Collections must have a getId function & use an id for update/delete operators ([#134](https://github.com/TanStack/db/pull/134))
1221
1222- the `keyBy` query operator has been removed, keying withing the query pipeline is now automatic ([#144](https://github.com/TanStack/db/pull/144))
1223
1224- Updated dependencies [[`1fbb844`](https://github.com/TanStack/db/commit/1fbb8447d8425d37cb9ab4f078ffab999b28b06c), [`338efc2`](https://github.com/TanStack/db/commit/338efc229c3794da5ac373b8b26143e379433407), [`ee5d026`](https://github.com/TanStack/db/commit/ee5d026715962dd0232fcaca513a8fac9189dce2), [`e7b036c`](https://github.com/TanStack/db/commit/e7b036ce6ebd17c94cc944d6d96ca2c645921c3e), [`e4feb0c`](https://github.com/TanStack/db/commit/e4feb0c214835675b47f0aa18a72d004a423df03)]:
1225 - @tanstack/db@0.0.5
1226
1227## 0.0.4
1228
1229### Patch Changes
1230
1231- Updated dependencies [[`8ce449e`](https://github.com/TanStack/db/commit/8ce449ed6d070e9e591d1b74b0db5fed7a3fc92f)]:
1232 - @tanstack/db@0.0.4
1233
1234## 0.0.3
1235
1236### Patch Changes
1237
1238- Updated dependencies [[`b29420b`](https://github.com/TanStack/db/commit/b29420bcdae30dfeffeef63a8753b83306a54e5a)]:
1239 - @tanstack/db@0.0.3
1240
1241## 0.0.2
1242
1243### Patch Changes
1244
1245- Fixed an issue with injecting the optimistic state removal into the reactive live query. ([#78](https://github.com/TanStack/db/pull/78))
1246
1247- Updated dependencies [[`4c82edb`](https://github.com/TanStack/db/commit/4c82edb9547f26c9de44f5bf43d4385c38920672)]:
1248 - @tanstack/db@0.0.2
1249
1250## 0.0.3
1251
1252### Patch Changes
1253
1254- Make transactions first class & move ownership of mutationFn from collections to transactions ([#53](https://github.com/TanStack/db/pull/53))
1255
1256- Updated dependencies [[`b42479c`](https://github.com/TanStack/db/commit/b42479cf95f9a820b36e01684b13a9179973f3d8)]:
1257 - @tanstack/db@0.0.3
1258
1259## 0.0.2
1260
1261### Patch Changes
1262
1263- make mutationFn optional for read-only collections ([#12](https://github.com/TanStack/db/pull/12))
1264
1265- Updated dependencies [[`9bb6e89`](https://github.com/TanStack/db/commit/9bb6e8909cebdcd7c03091bfc12dd37f5ab2e1ea), [`8eb7e9b`](https://github.com/TanStack/db/commit/8eb7e9b1d1f569c5c064e0f440257589486b73cf)]:
1266 - @tanstack/db@0.0.2
1267
1268## 0.0.1
1269
1270### Patch Changes
1271
1272- feat: Initial release ([#2](https://github.com/TanStack/db/pull/2))
1273
1274- Updated dependencies [[`2d2dd77`](https://github.com/TanStack/db/commit/2d2dd7743f715ffefaeee8e8d11173b751c7043b)]:
1275 - @tanstack/db@0.0.1