Skip to content
Source
Sign inSign up
TanStack/db

Query Driven Sync with On-Demand Collection Loading #763

Mergedsamwillis(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/763/headmerged by samwillis(GitHub profile, opens in a new tab)

Showing 177 changed files with 49 additions and 0 deletions (loading 173).

x
0 of 177 viewed, 177 left
5 additions and 0 deletions.changeset/all-meals-follow.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+"@tanstack/db": patch
+---
+​
+Add optional compareOptions to collection configuration.
39 additions and 0 deletions.changeset/expression-helpers-queryfn.mdAdded
View file
@@ -0,0 +1,39 @@
+---
+"@tanstack/db": patch
+"@tanstack/query-db-collection": patch
+---
+​
+Add expression helper utilities for parsing LoadSubsetOptions in queryFn.
+​
+When using `syncMode: 'on-demand'`, TanStack DB now provides helper functions to easily parse where clauses, orderBy, and limit predicates into your API's format:
+​
+- `parseWhereExpression`: Parse where clauses with custom handlers for each operator
+- `parseOrderByExpression`: Parse order by into simple array format
+- `extractSimpleComparisons`: Extract simple AND-ed filters
+- `parseLoadSubsetOptions`: Convenience function to parse all options at once
+- `walkExpression`, `extractFieldPath`, `extractValue`: Lower-level helpers
+​
+**Example:**
+​