diff --git a/.changeset/add-timeout-support-electric.md b/.changeset/add-timeout-support-electric.md deleted file mode 100644 index 144e6eae2..000000000 --- a/.changeset/add-timeout-support-electric.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -"@tanstack/electric-db-collection": minor ---- - -Add timeout support to electricCollectionOptions matching strategies. You can now specify a custom timeout when returning txids from mutation handlers (onInsert, onUpdate, onDelete). - -Previously, users could only customize timeouts when manually calling `collection.utils.awaitTxId()`, but not when using the automatic txid matching strategy. - -**Example:** - -```ts -const collection = createCollection( - electricCollectionOptions({ - // ... other config - onInsert: async ({ transaction }) => { - const newItem = transaction.mutations[0].modified - const result = await api.todos.create({ data: newItem }) - // Specify custom timeout (in milliseconds) - return { txid: result.txid, timeout: 10000 } - }, - }) -) -``` - -The timeout parameter is optional and defaults to 5000ms when not specified. It works with both single txids and arrays of txids. diff --git a/.changeset/all-meals-follow.md b/.changeset/all-meals-follow.md deleted file mode 100644 index 22237a818..000000000 --- a/.changeset/all-meals-follow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tanstack/db": patch ---- - -Add optional compareOptions to collection configuration. diff --git a/.changeset/expression-helpers-queryfn.md b/.changeset/expression-helpers-queryfn.md deleted file mode 100644 index 5a0629caa..000000000 --- a/.changeset/expression-helpers-queryfn.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -"@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:** - -```typescript -import { parseLoadSubsetOptions } from "@tanstack/db" -// or from "@tanstack/query-db-collection" (re-exported for convenience) - -queryFn: async (ctx) => { - const { where, orderBy, limit } = ctx.meta.loadSubsetOptions - - const parsed = parseLoadSubsetOptions({ where, orderBy, limit }) - - // Build API request from parsed filters - const params = new URLSearchParams() - parsed.filters.forEach(({ field, operator, value }) => { - if (operator === "eq") { - params.set(field.join("."), String(value)) - } - }) - - return fetch(`/api/products?${params}`).then((r) => r.json()) -} -``` - -This eliminates the need to manually traverse expression AST trees when implementing predicate push-down. diff --git a/.changeset/fix-array-txid-handling.md b/.changeset/fix-array-txid-handling.md deleted file mode 100644 index 9936396b7..000000000 --- a/.changeset/fix-array-txid-handling.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tanstack/electric-db-collection": patch ---- - -Fix array txid handling in electric collection handlers. When returning `{ txid: [txid1, txid2] }` from an `onInsert`, `onUpdate`, or `onDelete` handler, the system would timeout with `TimeoutWaitingForTxIdError` instead of properly waiting for all txids. The bug was caused by passing array indices as timeout parameters when calling `awaitTxId` via `.map()`. diff --git a/.changeset/fix-uint8array-comparison.md b/.changeset/fix-uint8array-comparison.md deleted file mode 100644 index d41bb47f9..000000000 --- a/.changeset/fix-uint8array-comparison.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@tanstack/db": patch -"@tanstack/db-ivm": patch ---- - -Fix Uint8Array/Buffer comparison to work by content instead of reference. This enables proper equality checks for binary IDs like ULIDs in WHERE clauses using the `eq` function. diff --git a/.changeset/honest-radios-appear.md b/.changeset/honest-radios-appear.md deleted file mode 100644 index 96d2acde8..000000000 --- a/.changeset/honest-radios-appear.md +++ /dev/null @@ -1,4 +0,0 @@ ---- ---- - -fix(docs): fix doc links having incorrect file name casing diff --git a/.changeset/legal-cooks-sink.md b/.changeset/legal-cooks-sink.md deleted file mode 100644 index ddddba41d..000000000 --- a/.changeset/legal-cooks-sink.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tanstack/db-ivm": patch ---- - -Fix bug with setWindow on ordered queries that have no limit. diff --git a/.changeset/light-phones-flash.md b/.changeset/light-phones-flash.md deleted file mode 100644 index 95a030b32..000000000 --- a/.changeset/light-phones-flash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@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. diff --git a/.changeset/open-cups-lose.md b/.changeset/open-cups-lose.md deleted file mode 100644 index 44eee1a35..000000000 --- a/.changeset/open-cups-lose.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tanstack/db": patch ---- - -Add support for orderBy and limit in currentStateAsChanges function diff --git a/.changeset/silent-trains-tell.md b/.changeset/silent-trains-tell.md deleted file mode 100644 index 414dd8c89..000000000 --- a/.changeset/silent-trains-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tanstack/query-db-collection": patch ---- - -Handle pushed-down predicates diff --git a/.changeset/tender-carpets-cheat.md b/.changeset/tender-carpets-cheat.md deleted file mode 100644 index 77c9dfd73..000000000 --- a/.changeset/tender-carpets-cheat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tanstack/electric-db-collection": patch ---- - -Handle predicates that are pushed down. diff --git a/.changeset/two-lamps-wave.md b/.changeset/two-lamps-wave.md deleted file mode 100644 index ef2cd032a..000000000 --- a/.changeset/two-lamps-wave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tanstack/db": patch ---- - -Adds an onDeduplicate callback on the DeduplicatedLoadSubset class which is called when a loadSubset call is deduplicated diff --git a/.changeset/whole-pants-strive.md b/.changeset/whole-pants-strive.md deleted file mode 100644 index 14fdca893..000000000 --- a/.changeset/whole-pants-strive.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -"@tanstack/db": minor ---- - -Implement 3-valued logic (true/false/unknown) for all comparison and logical operators. -Queries with null/undefined values now behave consistently with SQL databases, where UNKNOWN results exclude rows from WHERE clauses. - -**Breaking Change**: This changes the behavior of `WHERE` and `HAVING` clauses when dealing with `null` and `undefined` values. - -**Example 1: Equality checks with null** - -Previously, this query would return all persons with `age = null`: - -```ts -q.from(...).where(({ person }) => eq(person.age, null)) -``` - -With 3-valued logic, `eq(anything, null)` evaluates to `null` (UNKNOWN) and is filtered out. Use `isNull()` instead: - -```ts -q.from(...).where(({ person }) => isNull(person.age)) -``` - -**Example 2: Comparisons with null values** - -Previously, this query would return persons with `age < 18` OR `age = null`: - -```ts -q.from(...).where(({ person }) => lt(person.age, 18)) -``` - -With 3-valued logic, `lt(null, 18)` evaluates to `null` (UNKNOWN) and is filtered out. The same applies to `undefined` values. To include null values, combine with `isNull()`: - -```ts -q.from(...).where(({ person }) => - or(lt(person.age, 18), isNull(person.age)) -) -``` diff --git a/examples/react/offline-transactions/package.json b/examples/react/offline-transactions/package.json index 4db09a7a3..7723a4862 100644 --- a/examples/react/offline-transactions/package.json +++ b/examples/react/offline-transactions/package.json @@ -9,9 +9,9 @@ "start": "node .output/server/index.mjs" }, "dependencies": { - "@tanstack/offline-transactions": ">=0.0.0 <1.0.0", - "@tanstack/query-db-collection": ">=0.0.0 <1.0.0", - "@tanstack/react-db": ">=0.0.0 <1.0.0", + "@tanstack/offline-transactions": ">=1.0.0", + "@tanstack/query-db-collection": ">=1.0.0", + "@tanstack/react-db": ">=0.1.44", "@tanstack/react-query": "^5.89.0", "@tanstack/react-router": "^1.131.47", "@tanstack/react-router-devtools": "^1.131.47", diff --git a/examples/react/projects/package.json b/examples/react/projects/package.json index 099640b6e..5be649b9f 100644 --- a/examples/react/projects/package.json +++ b/examples/react/projects/package.json @@ -17,8 +17,8 @@ "dependencies": { "@tailwindcss/vite": "^4.1.16", "@tanstack/query-core": "^5.90.5", - "@tanstack/query-db-collection": ">=0.0.0 <1.0.0", - "@tanstack/react-db": ">=0.0.0 <1.0.0", + "@tanstack/query-db-collection": ">=1.0.0", + "@tanstack/react-db": ">=0.1.44", "@tanstack/react-router": "^1.133.32", "@tanstack/react-router-devtools": "^1.133.32", "@tanstack/react-router-with-query": "^1.130.17", diff --git a/examples/react/todo/CHANGELOG.md b/examples/react/todo/CHANGELOG.md index 773b90a93..7ce4bd1d5 100644 --- a/examples/react/todo/CHANGELOG.md +++ b/examples/react/todo/CHANGELOG.md @@ -1,5 +1,15 @@ # examples/react/todo +## 0.1.24 + +### Patch Changes + +- Updated dependencies [[`1afb027`](https://github.com/TanStack/db/commit/1afb027dbf3e34292a418fc549f799c4e0ce8922), [`f9d11fc`](https://github.com/TanStack/db/commit/f9d11fc3d7297c61feb3c6876cb2f436edbb5b34), [`58f119a`](https://github.com/TanStack/db/commit/58f119ac4f1b05dbfff8617f59f53973abdb1920), [`8f746db`](https://github.com/TanStack/db/commit/8f746db61ff160eae9834e0b9d83c40ef315ae12), [`7aceffa`](https://github.com/TanStack/db/commit/7aceffa46e746cff3dee51230dd2f9e09cb24137)]: + - @tanstack/electric-db-collection@0.2.0 + - @tanstack/query-db-collection@1.0.0 + - @tanstack/react-db@0.1.44 + - @tanstack/trailbase-db-collection@0.1.44 + ## 0.1.23 ### Patch Changes diff --git a/examples/react/todo/package.json b/examples/react/todo/package.json index 3e3410b74..98557b5ee 100644 --- a/examples/react/todo/package.json +++ b/examples/react/todo/package.json @@ -1,15 +1,15 @@ { "name": "@tanstack/db-example-react-todo", "private": true, - "version": "0.1.23", + "version": "0.1.24", "dependencies": { - "@tanstack/electric-db-collection": ">=0.0.0 <1.0.0", + "@tanstack/electric-db-collection": ">=0.2.0", "@tanstack/query-core": "^5.90.5", - "@tanstack/query-db-collection": ">=0.0.0 <1.0.0", - "@tanstack/react-db": ">=0.0.0 <1.0.0", + "@tanstack/query-db-collection": ">=1.0.0", + "@tanstack/react-db": ">=0.1.44", "@tanstack/react-router": "^1.133.32", "@tanstack/react-start": "^1.133.32", - "@tanstack/trailbase-db-collection": ">=0.0.0 <1.0.0", + "@tanstack/trailbase-db-collection": ">=0.1.44", "cors": "^2.8.5", "drizzle-orm": "^0.44.7", "drizzle-zod": "^0.8.3", diff --git a/packages/angular-db/CHANGELOG.md b/packages/angular-db/CHANGELOG.md index fa2fadfd1..8ce17e54a 100644 --- a/packages/angular-db/CHANGELOG.md +++ b/packages/angular-db/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/angular-db +## 0.1.26 + +### Patch Changes + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.1.25 ### Patch Changes diff --git a/packages/angular-db/package.json b/packages/angular-db/package.json index 394e0ecd3..66ac05673 100644 --- a/packages/angular-db/package.json +++ b/packages/angular-db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/angular-db", "description": "Angular integration for @tanstack/db", - "version": "0.1.25", + "version": "0.1.26", "author": "Ethan McDaniel", "license": "MIT", "repository": { diff --git a/packages/db-collection-e2e/CHANGELOG.md b/packages/db-collection-e2e/CHANGELOG.md new file mode 100644 index 000000000..75f8bcfbc --- /dev/null +++ b/packages/db-collection-e2e/CHANGELOG.md @@ -0,0 +1,10 @@ +# @tanstack/db-collection-e2e + +## 0.0.2 + +### Patch Changes + +- Updated dependencies [[`1afb027`](https://github.com/TanStack/db/commit/1afb027dbf3e34292a418fc549f799c4e0ce8922), [`243a35a`](https://github.com/TanStack/db/commit/243a35a632ee0aca20c3ee12ee2ac2929d8be11d), [`f9d11fc`](https://github.com/TanStack/db/commit/f9d11fc3d7297c61feb3c6876cb2f436edbb5b34), [`58f119a`](https://github.com/TanStack/db/commit/58f119ac4f1b05dbfff8617f59f53973abdb1920), [`7aedf12`](https://github.com/TanStack/db/commit/7aedf12996a67ef64010bca0d78d51c919dd384f), [`28f81b5`](https://github.com/TanStack/db/commit/28f81b5165d0a9566f99c2b6cf0ad09533e1a2cb), [`28f81b5`](https://github.com/TanStack/db/commit/28f81b5165d0a9566f99c2b6cf0ad09533e1a2cb), [`8f746db`](https://github.com/TanStack/db/commit/8f746db61ff160eae9834e0b9d83c40ef315ae12), [`7aceffa`](https://github.com/TanStack/db/commit/7aceffa46e746cff3dee51230dd2f9e09cb24137), [`f6ac7ea`](https://github.com/TanStack/db/commit/f6ac7eac50ae1334ddb173786a68c9fc732848f9), [`01093a7`](https://github.com/TanStack/db/commit/01093a762cf2f5f308edec7f466d1c3dabb5ea9f)]: + - @tanstack/electric-db-collection@0.2.0 + - @tanstack/db@0.5.0 + - @tanstack/query-db-collection@1.0.0 diff --git a/packages/db-collection-e2e/package.json b/packages/db-collection-e2e/package.json index 69b4eff42..fa0b4b0f8 100644 --- a/packages/db-collection-e2e/package.json +++ b/packages/db-collection-e2e/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/db-collection-e2e", - "version": "0.0.1", + "version": "0.0.2", "private": true, "description": "End-to-end test suite for TanStack DB collections", "type": "module", diff --git a/packages/db-ivm/CHANGELOG.md b/packages/db-ivm/CHANGELOG.md index 609a9602d..86fde439c 100644 --- a/packages/db-ivm/CHANGELOG.md +++ b/packages/db-ivm/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/db-ivm +## 0.1.13 + +### Patch Changes + +- Fix Uint8Array/Buffer comparison to work by content instead of reference. This enables proper equality checks for binary IDs like ULIDs in WHERE clauses using the `eq` function. ([#779](https://github.com/TanStack/db/pull/779)) + +- Fix bug with setWindow on ordered queries that have no limit. ([#763](https://github.com/TanStack/db/pull/763)) + ## 0.1.12 ### Patch Changes diff --git a/packages/db-ivm/package.json b/packages/db-ivm/package.json index e6e8608e3..2cebd299a 100644 --- a/packages/db-ivm/package.json +++ b/packages/db-ivm/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/db-ivm", "description": "Incremental View Maintenance for TanStack DB based on Differential Dataflow", - "version": "0.1.12", + "version": "0.1.13", "dependencies": { "fractional-indexing": "^3.2.0", "sorted-btree": "^1.8.1" diff --git a/packages/db/CHANGELOG.md b/packages/db/CHANGELOG.md index 1479f7098..bb9327fd3 100644 --- a/packages/db/CHANGELOG.md +++ b/packages/db/CHANGELOG.md @@ -1,5 +1,93 @@ # @tanstack/db +## 0.5.0 + +### Minor Changes + +- Implement 3-valued logic (true/false/unknown) for all comparison and logical operators. ([#765](https://github.com/TanStack/db/pull/765)) + Queries with null/undefined values now behave consistently with SQL databases, where UNKNOWN results exclude rows from WHERE clauses. + + **Breaking Change**: This changes the behavior of `WHERE` and `HAVING` clauses when dealing with `null` and `undefined` values. + + **Example 1: Equality checks with null** + + Previously, this query would return all persons with `age = null`: + + ```ts + q.from(...).where(({ person }) => eq(person.age, null)) + ``` + + With 3-valued logic, `eq(anything, null)` evaluates to `null` (UNKNOWN) and is filtered out. Use `isNull()` instead: + + ```ts + q.from(...).where(({ person }) => isNull(person.age)) + ``` + + **Example 2: Comparisons with null values** + + Previously, this query would return persons with `age < 18` OR `age = null`: + + ```ts + q.from(...).where(({ person }) => lt(person.age, 18)) + ``` + + With 3-valued logic, `lt(null, 18)` evaluates to `null` (UNKNOWN) and is filtered out. The same applies to `undefined` values. To include null values, combine with `isNull()`: + + ```ts + q.from(...).where(({ person }) => + or(lt(person.age, 18), isNull(person.age)) + ) + ``` + +### Patch Changes + +- Add optional compareOptions to collection configuration. ([#763](https://github.com/TanStack/db/pull/763)) + +- Add expression helper utilities for parsing LoadSubsetOptions in queryFn. ([#763](https://github.com/TanStack/db/pull/763)) + + 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:** + + ```typescript + import { parseLoadSubsetOptions } from "@tanstack/db" + // or from "@tanstack/query-db-collection" (re-exported for convenience) + + queryFn: async (ctx) => { + const { where, orderBy, limit } = ctx.meta.loadSubsetOptions + + const parsed = parseLoadSubsetOptions({ where, orderBy, limit }) + + // Build API request from parsed filters + const params = new URLSearchParams() + parsed.filters.forEach(({ field, operator, value }) => { + if (operator === "eq") { + params.set(field.join("."), String(value)) + } + }) + + return fetch(`/api/products?${params}`).then((r) => r.json()) + } + ``` + + This eliminates the need to manually traverse expression AST trees when implementing predicate push-down. + +- Fix Uint8Array/Buffer comparison to work by content instead of reference. This enables proper equality checks for binary IDs like ULIDs in WHERE clauses using the `eq` function. ([#779](https://github.com/TanStack/db/pull/779)) + +- 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. ([#763](https://github.com/TanStack/db/pull/763)) + +- Add support for orderBy and limit in currentStateAsChanges function ([#763](https://github.com/TanStack/db/pull/763)) + +- Adds an onDeduplicate callback on the DeduplicatedLoadSubset class which is called when a loadSubset call is deduplicated ([#763](https://github.com/TanStack/db/pull/763)) + +- Updated dependencies [[`7aedf12`](https://github.com/TanStack/db/commit/7aedf12996a67ef64010bca0d78d51c919dd384f), [`28f81b5`](https://github.com/TanStack/db/commit/28f81b5165d0a9566f99c2b6cf0ad09533e1a2cb)]: + - @tanstack/db-ivm@0.1.13 + ## 0.4.20 ### Patch Changes diff --git a/packages/db/package.json b/packages/db/package.json index ac315d095..584d63217 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/db", "description": "A reactive client store for building super fast apps on sync", - "version": "0.4.20", + "version": "0.5.0", "dependencies": { "@standard-schema/spec": "^1.0.0", "@tanstack/db-ivm": "workspace:*", diff --git a/packages/electric-db-collection/CHANGELOG.md b/packages/electric-db-collection/CHANGELOG.md index 21519da60..0200e4db1 100644 --- a/packages/electric-db-collection/CHANGELOG.md +++ b/packages/electric-db-collection/CHANGELOG.md @@ -1,5 +1,40 @@ # @tanstack/electric-db-collection +## 0.2.0 + +### Minor Changes + +- Add timeout support to electricCollectionOptions matching strategies. You can now specify a custom timeout when returning txids from mutation handlers (onInsert, onUpdate, onDelete). ([#798](https://github.com/TanStack/db/pull/798)) + + Previously, users could only customize timeouts when manually calling `collection.utils.awaitTxId()`, but not when using the automatic txid matching strategy. + + **Example:** + + ```ts + const collection = createCollection( + electricCollectionOptions({ + // ... other config + onInsert: async ({ transaction }) => { + const newItem = transaction.mutations[0].modified + const result = await api.todos.create({ data: newItem }) + // Specify custom timeout (in milliseconds) + return { txid: result.txid, timeout: 10000 } + }, + }) + ) + ``` + + The timeout parameter is optional and defaults to 5000ms when not specified. It works with both single txids and arrays of txids. + +### Patch Changes + +- Fix array txid handling in electric collection handlers. When returning `{ txid: [txid1, txid2] }` from an `onInsert`, `onUpdate`, or `onDelete` handler, the system would timeout with `TimeoutWaitingForTxIdError` instead of properly waiting for all txids. The bug was caused by passing array indices as timeout parameters when calling `awaitTxId` via `.map()`. ([#795](https://github.com/TanStack/db/pull/795)) + +- Handle predicates that are pushed down. ([#763](https://github.com/TanStack/db/pull/763)) + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.1.44 ### Patch Changes diff --git a/packages/electric-db-collection/package.json b/packages/electric-db-collection/package.json index 04f285386..785180139 100644 --- a/packages/electric-db-collection/package.json +++ b/packages/electric-db-collection/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/electric-db-collection", "description": "ElectricSQL collection for TanStack DB", - "version": "0.1.44", + "version": "0.2.0", "dependencies": { "@electric-sql/client": "^1.1.0", "@standard-schema/spec": "^1.0.0", diff --git a/packages/offline-transactions/CHANGELOG.md b/packages/offline-transactions/CHANGELOG.md index e74723920..0c12f3ce2 100644 --- a/packages/offline-transactions/CHANGELOG.md +++ b/packages/offline-transactions/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/offline-transactions +## 1.0.0 + +### Patch Changes + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.1.3 ### Patch Changes diff --git a/packages/offline-transactions/package.json b/packages/offline-transactions/package.json index 488f1de21..01e3e6b6a 100644 --- a/packages/offline-transactions/package.json +++ b/packages/offline-transactions/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/offline-transactions", - "version": "0.1.3", + "version": "1.0.0", "description": "Offline-first transaction capabilities for TanStack DB", "author": "TanStack", "license": "MIT", diff --git a/packages/powersync-db-collection/CHANGELOG.md b/packages/powersync-db-collection/CHANGELOG.md index 8ccb68d86..231d4d7b8 100644 --- a/packages/powersync-db-collection/CHANGELOG.md +++ b/packages/powersync-db-collection/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/powersync-db-collection +## 0.1.4 + +### Patch Changes + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.1.3 ### Patch Changes diff --git a/packages/powersync-db-collection/package.json b/packages/powersync-db-collection/package.json index a59cc2255..19eceb479 100644 --- a/packages/powersync-db-collection/package.json +++ b/packages/powersync-db-collection/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/powersync-db-collection", "description": "PowerSync collection for TanStack DB", - "version": "0.1.3", + "version": "0.1.4", "dependencies": { "@standard-schema/spec": "^1.0.0", "@tanstack/db": "workspace:*", diff --git a/packages/query-db-collection/CHANGELOG.md b/packages/query-db-collection/CHANGELOG.md index c95fb53a4..f6c900118 100644 --- a/packages/query-db-collection/CHANGELOG.md +++ b/packages/query-db-collection/CHANGELOG.md @@ -1,5 +1,48 @@ # @tanstack/query-db-collection +## 1.0.0 + +### Patch Changes + +- Add expression helper utilities for parsing LoadSubsetOptions in queryFn. ([#763](https://github.com/TanStack/db/pull/763)) + + 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:** + + ```typescript + import { parseLoadSubsetOptions } from "@tanstack/db" + // or from "@tanstack/query-db-collection" (re-exported for convenience) + + queryFn: async (ctx) => { + const { where, orderBy, limit } = ctx.meta.loadSubsetOptions + + const parsed = parseLoadSubsetOptions({ where, orderBy, limit }) + + // Build API request from parsed filters + const params = new URLSearchParams() + parsed.filters.forEach(({ field, operator, value }) => { + if (operator === "eq") { + params.set(field.join("."), String(value)) + } + }) + + return fetch(`/api/products?${params}`).then((r) => r.json()) + } + ``` + + This eliminates the need to manually traverse expression AST trees when implementing predicate push-down. + +- Handle pushed-down predicates ([#763](https://github.com/TanStack/db/pull/763)) + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.3.0 ### Minor Changes diff --git a/packages/query-db-collection/package.json b/packages/query-db-collection/package.json index ae2f124e8..7255f6ea6 100644 --- a/packages/query-db-collection/package.json +++ b/packages/query-db-collection/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/query-db-collection", "description": "TanStack Query collection for TanStack DB", - "version": "0.3.0", + "version": "1.0.0", "dependencies": { "@standard-schema/spec": "^1.0.0" }, diff --git a/packages/react-db/CHANGELOG.md b/packages/react-db/CHANGELOG.md index d125f996b..6f2d21f5c 100644 --- a/packages/react-db/CHANGELOG.md +++ b/packages/react-db/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/react-db +## 0.1.44 + +### Patch Changes + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.1.43 ### Patch Changes diff --git a/packages/react-db/package.json b/packages/react-db/package.json index e26bb38b1..63d156fe2 100644 --- a/packages/react-db/package.json +++ b/packages/react-db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/react-db", "description": "React integration for @tanstack/db", - "version": "0.1.43", + "version": "0.1.44", "author": "Kyle Mathews", "license": "MIT", "repository": { diff --git a/packages/rxdb-db-collection/CHANGELOG.md b/packages/rxdb-db-collection/CHANGELOG.md index a50e49d9a..6c313009b 100644 --- a/packages/rxdb-db-collection/CHANGELOG.md +++ b/packages/rxdb-db-collection/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/rxdb-db-collection +## 0.1.32 + +### Patch Changes + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.1.31 ### Patch Changes diff --git a/packages/rxdb-db-collection/package.json b/packages/rxdb-db-collection/package.json index 55a146f6c..075b74d19 100644 --- a/packages/rxdb-db-collection/package.json +++ b/packages/rxdb-db-collection/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/rxdb-db-collection", "description": "RxDB collection for TanStack DB", - "version": "0.1.31", + "version": "0.1.32", "dependencies": { "rxdb": "16.20.0", "@standard-schema/spec": "^1.0.0", diff --git a/packages/solid-db/CHANGELOG.md b/packages/solid-db/CHANGELOG.md index 9d8bebb83..cd3da5fd2 100644 --- a/packages/solid-db/CHANGELOG.md +++ b/packages/solid-db/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/react-db +## 0.1.43 + +### Patch Changes + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.1.42 ### Patch Changes diff --git a/packages/solid-db/package.json b/packages/solid-db/package.json index 03559e22d..8a757a5bc 100644 --- a/packages/solid-db/package.json +++ b/packages/solid-db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/solid-db", "description": "Solid integration for @tanstack/db", - "version": "0.1.42", + "version": "0.1.43", "author": "Kyle Mathews", "license": "MIT", "repository": { diff --git a/packages/svelte-db/CHANGELOG.md b/packages/svelte-db/CHANGELOG.md index 16d01c4d0..a118ee08d 100644 --- a/packages/svelte-db/CHANGELOG.md +++ b/packages/svelte-db/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/svelte-db +## 0.1.43 + +### Patch Changes + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.1.42 ### Patch Changes diff --git a/packages/svelte-db/package.json b/packages/svelte-db/package.json index d122d8e7a..1de36a919 100644 --- a/packages/svelte-db/package.json +++ b/packages/svelte-db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/svelte-db", "description": "Svelte integration for @tanstack/db", - "version": "0.1.42", + "version": "0.1.43", "dependencies": { "@tanstack/db": "workspace:*" }, diff --git a/packages/trailbase-db-collection/CHANGELOG.md b/packages/trailbase-db-collection/CHANGELOG.md index 44400ad1a..bc39315b9 100644 --- a/packages/trailbase-db-collection/CHANGELOG.md +++ b/packages/trailbase-db-collection/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/trailbase-db-collection +## 0.1.44 + +### Patch Changes + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.1.43 ### Patch Changes diff --git a/packages/trailbase-db-collection/package.json b/packages/trailbase-db-collection/package.json index f73ef9fe9..6f01c2ea5 100644 --- a/packages/trailbase-db-collection/package.json +++ b/packages/trailbase-db-collection/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/trailbase-db-collection", "description": "TrailBase collection for TanStack DB", - "version": "0.1.43", + "version": "0.1.44", "dependencies": { "@standard-schema/spec": "^1.0.0", "@tanstack/db": "workspace:*", diff --git a/packages/vue-db/CHANGELOG.md b/packages/vue-db/CHANGELOG.md index 79077a0f2..aef427f9b 100644 --- a/packages/vue-db/CHANGELOG.md +++ b/packages/vue-db/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/vue-db +## 0.0.76 + +### Patch Changes + +- 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)]: + - @tanstack/db@0.5.0 + ## 0.0.75 ### Patch Changes diff --git a/packages/vue-db/package.json b/packages/vue-db/package.json index 47c59c645..5f263963f 100644 --- a/packages/vue-db/package.json +++ b/packages/vue-db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/vue-db", "description": "Vue integration for @tanstack/db", - "version": "0.0.75", + "version": "0.0.76", "author": "Kyle Mathews", "license": "MIT", "repository": {