@tanstack/db 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +14 -14
- package/dist/cjs/query/compiler/joins.cjs +8 -1
- package/dist/cjs/query/compiler/joins.cjs.map +1 -1
- package/dist/cjs/query/live/collection-config-builder.cjs +3 -2
- package/dist/cjs/query/live/collection-config-builder.cjs.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/query/compiler/joins.js +8 -1
- package/dist/esm/query/compiler/joins.js.map +1 -1
- package/dist/esm/query/live/collection-config-builder.js +3 -2
- package/dist/esm/query/live/collection-config-builder.js.map +1 -1
- package/package.json +1 -1
- package/src/query/compiler/joins.ts +14 -2
- package/src/query/live/collection-config-builder.ts +3 -1
package/package.json
CHANGED
|
@@ -302,8 +302,20 @@ function processJoin(
|
|
|
302
302
|
return
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
//
|
|
306
|
-
const joinKeys =
|
|
305
|
+
// Deduplicate and filter null keys before requesting snapshot
|
|
306
|
+
const joinKeys = [
|
|
307
|
+
...new Set(
|
|
308
|
+
data
|
|
309
|
+
.getInner()
|
|
310
|
+
.map(([[joinKey]]) => joinKey)
|
|
311
|
+
.filter((key) => key != null),
|
|
312
|
+
),
|
|
313
|
+
]
|
|
314
|
+
|
|
315
|
+
if (joinKeys.length === 0) {
|
|
316
|
+
return
|
|
317
|
+
}
|
|
318
|
+
|
|
307
319
|
const lazyJoinRef = new PropRef(followRefResult.path)
|
|
308
320
|
const loaded = lazySourceSubscription.requestSnapshot({
|
|
309
321
|
where: inArray(lazyJoinRef, joinKeys),
|
|
@@ -227,7 +227,8 @@ export class CollectionConfigBuilder<
|
|
|
227
227
|
id: this.id,
|
|
228
228
|
getKey:
|
|
229
229
|
this.config.getKey ||
|
|
230
|
-
((item) =>
|
|
230
|
+
((item: any) =>
|
|
231
|
+
(this.resultKeys.get(item) ?? item.$key) as string | number),
|
|
231
232
|
sync: this.getSyncConfig(),
|
|
232
233
|
compare: this.compare,
|
|
233
234
|
defaultStringCollation: this.compareOptions,
|
|
@@ -1515,6 +1516,7 @@ function createChildCollectionEntry(
|
|
|
1515
1516
|
},
|
|
1516
1517
|
},
|
|
1517
1518
|
startSync: true,
|
|
1519
|
+
gcTime: 0,
|
|
1518
1520
|
})
|
|
1519
1521
|
|
|
1520
1522
|
const entry: ChildCollectionEntry = {
|