Skip to content
Source
Sign inSign up
TanStack/db

fix(db-sqlite-persistence-core): add schema-aware overloads to persistedCollectionOptions #1453

Closedmerodiro(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/1453/headopened

Showing 3 changed files with 62 additions and 2 deletions (loading 1).

x
0 of 3 viewed, 3 left
5 additions and 0 deletions.changeset/calm-toes-approve.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/db-sqlite-persistence-core': patch
+---
+​
+Add schema-aware overloads to `persistedCollectionOptions` so schema-based calls infer the correct types and remain compatible with `createCollection`.
57 additions and 2 deletionspackages/db-sqlite-persistence-core/src/persisted.tsModified
View file
@@ -14,6 +14,7 @@
CollectionConfig,
CollectionIndexMetadata,
DeleteMutationFnParams,
+ InferSchemaOutput,
InsertMutationFnParams,
LoadSubsetOptions,
PendingMutation,
@@ -2572,22 +2573,76 @@
+// Overload for when schema is provided and sync is present
export function persistedCollectionOptions<
+ TSchema extends StandardSchemaV1,