Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .changeset/add-timeout-support-electric.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/all-meals-follow.md

This file was deleted.

39 changes: 0 additions & 39 deletions .changeset/expression-helpers-queryfn.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-array-txid-handling.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/fix-uint8array-comparison.md

This file was deleted.

4 changes: 0 additions & 4 deletions .changeset/honest-radios-appear.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/legal-cooks-sink.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/light-phones-flash.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/open-cups-lose.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/silent-trains-tell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tender-carpets-cheat.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/two-lamps-wave.md

This file was deleted.

38 changes: 0 additions & 38 deletions .changeset/whole-pants-strive.md

This file was deleted.

6 changes: 3 additions & 3 deletions examples/react/offline-transactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions examples/react/projects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions examples/react/todo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions examples/react/todo/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions packages/angular-db/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-db/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
10 changes: 10 additions & 0 deletions packages/db-collection-e2e/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion packages/db-collection-e2e/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 8 additions & 0 deletions packages/db-ivm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/db-ivm/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
88 changes: 88 additions & 0 deletions packages/db/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
@@ -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:*",
Expand Down
Loading