Skip to content
Open
5 changes: 5 additions & 0 deletions .changeset/light-phones-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tanstack/db": patch
---

Add predicate comparison and merging utilities (isWhereSubset, intersectWherePredicates, unionWherePredicates, and related functions) to support predicate push-down in collection sync operations, enabling efficient tracking of loaded data ranges and preventing redundant server requests. Includes performance optimizations for large primitive IN predicates and full support for Date objects in equality, range, and IN clause comparisons.
5 changes: 5 additions & 0 deletions .changeset/tender-carpets-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tanstack/electric-db-collection": patch
---

Handle predicates that are pushed down.
15 changes: 15 additions & 0 deletions packages/db/src/query/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,18 @@ export {

export { type LiveQueryCollectionConfig } from "./live/types.js"
export { type LiveQueryCollectionUtils } from "./live/collection-config-builder.js"

// Predicate utilities for predicate push-down
export {
isWhereSubset,
intersectWherePredicates,
unionWherePredicates,
minusWherePredicates,
isOrderBySubset,
isLimitSubset,
isPredicateSubset,
intersectPredicates,
unionPredicates,
} from "./predicate-utils.js"

export { DeduplicatedLoadSubset } from "./subset-dedupe.js"
Loading
Loading