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
17 changes: 0 additions & 17 deletions .changeset/index-optimization-partial-and-or.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/lazy-join-resolved-collection.md

This file was deleted.

15 changes: 0 additions & 15 deletions .changeset/nan-postgres-semantics.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/select-alias-prototype-pollution.md

This file was deleted.

4 changes: 2 additions & 2 deletions examples/angular/todos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@angular/forms": "^20.3.16",
"@angular/platform-browser": "^20.3.16",
"@angular/router": "^20.3.16",
"@tanstack/angular-db": "^0.1.70",
"@tanstack/db": "^0.6.10",
"@tanstack/angular-db": "^0.1.71",
"@tanstack/db": "^0.6.11",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "~0.15.0"
Expand Down
10 changes: 5 additions & 5 deletions examples/electron/offline-first/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"postinstall": "prebuild-install --runtime electron --target 40.2.1 --arch arm64 || echo 'prebuild-install failed, try: npx @electron/rebuild'"
},
"dependencies": {
"@tanstack/electron-db-sqlite-persistence": "^0.1.14",
"@tanstack/node-db-sqlite-persistence": "^0.2.2",
"@tanstack/offline-transactions": "^1.0.35",
"@tanstack/query-db-collection": "^1.0.42",
"@tanstack/react-db": "^0.1.88",
"@tanstack/electron-db-sqlite-persistence": "^0.1.15",
"@tanstack/node-db-sqlite-persistence": "^0.2.3",
"@tanstack/offline-transactions": "^1.0.36",
"@tanstack/query-db-collection": "^1.0.43",
"@tanstack/react-db": "^0.1.89",
"@tanstack/react-query": "^5.90.20",
"better-sqlite3": "^12.6.2",
"react": "^19.2.4",
Expand Down
10 changes: 5 additions & 5 deletions examples/react-native/offline-transactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"@op-engineering/op-sqlite": "^15.2.5",
"@react-native-async-storage/async-storage": "2.1.2",
"@react-native-community/netinfo": "11.4.1",
"@tanstack/db": "^0.6.10",
"@tanstack/offline-transactions": "^1.0.35",
"@tanstack/query-db-collection": "^1.0.42",
"@tanstack/react-db": "^0.1.88",
"@tanstack/react-native-db-sqlite-persistence": "^0.2.2",
"@tanstack/db": "^0.6.11",
"@tanstack/offline-transactions": "^1.0.36",
"@tanstack/query-db-collection": "^1.0.43",
"@tanstack/react-db": "^0.1.89",
"@tanstack/react-native-db-sqlite-persistence": "^0.2.3",
"@tanstack/react-query": "^5.90.20",
"expo": "~53.0.26",
"expo-constants": "~17.1.0",
Expand Down
10 changes: 5 additions & 5 deletions examples/react-native/shopping-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"@op-engineering/op-sqlite": "^15.2.5",
"@react-native-async-storage/async-storage": "2.1.2",
"@react-native-community/netinfo": "11.4.1",
"@tanstack/db": "^0.6.10",
"@tanstack/electric-db-collection": "^0.3.8",
"@tanstack/offline-transactions": "^1.0.35",
"@tanstack/react-db": "^0.1.88",
"@tanstack/react-native-db-sqlite-persistence": "^0.2.2",
"@tanstack/db": "^0.6.11",
"@tanstack/electric-db-collection": "^0.3.9",
"@tanstack/offline-transactions": "^1.0.36",
"@tanstack/react-db": "^0.1.89",
"@tanstack/react-native-db-sqlite-persistence": "^0.2.3",
"@tanstack/react-query": "^5.90.20",
"expo": "~53.0.26",
"expo-constants": "~17.1.0",
Expand Down
10 changes: 5 additions & 5 deletions examples/react/offline-transactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"build": "vite build && tsc --noEmit"
},
"dependencies": {
"@tanstack/browser-db-sqlite-persistence": "^0.2.2",
"@tanstack/db": "^0.6.10",
"@tanstack/offline-transactions": "^1.0.35",
"@tanstack/query-db-collection": "^1.0.42",
"@tanstack/react-db": "^0.1.88",
"@tanstack/browser-db-sqlite-persistence": "^0.2.3",
"@tanstack/db": "^0.6.11",
"@tanstack/offline-transactions": "^1.0.36",
"@tanstack/query-db-collection": "^1.0.43",
"@tanstack/react-db": "^0.1.89",
"@tanstack/react-query": "^5.90.20",
"@tanstack/react-router": "^1.159.5",
"@tanstack/react-router-devtools": "^1.159.5",
Expand Down
4 changes: 2 additions & 2 deletions examples/react/paced-mutations-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/db": "^0.6.10",
"@tanstack/react-db": "^0.1.88",
"@tanstack/db": "^0.6.11",
"@tanstack/react-db": "^0.1.89",
"mitt": "^3.0.1",
"react": "^19.2.4",
"react-dom": "^19.2.4"
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.18",
"@tanstack/query-core": "^5.90.20",
"@tanstack/query-db-collection": "^1.0.42",
"@tanstack/react-db": "^0.1.88",
"@tanstack/query-db-collection": "^1.0.43",
"@tanstack/react-db": "^0.1.89",
"@tanstack/react-router": "^1.159.5",
"@tanstack/react-router-devtools": "^1.159.5",
"@tanstack/react-router-with-query": "^1.130.17",
Expand Down
8 changes: 4 additions & 4 deletions examples/react/todo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"private": true,
"version": "0.1.25",
"dependencies": {
"@tanstack/electric-db-collection": "^0.3.8",
"@tanstack/electric-db-collection": "^0.3.9",
"@tanstack/query-core": "^5.90.20",
"@tanstack/query-db-collection": "^1.0.42",
"@tanstack/react-db": "^0.1.88",
"@tanstack/query-db-collection": "^1.0.43",
"@tanstack/react-db": "^0.1.89",
"@tanstack/react-router": "^1.159.5",
"@tanstack/react-start": "^1.159.5",
"@tanstack/trailbase-db-collection": "^0.1.88",
"@tanstack/trailbase-db-collection": "^0.1.89",
"cors": "^2.8.6",
"drizzle-orm": "^0.45.1",
"drizzle-zod": "^0.8.3",
Expand Down
8 changes: 4 additions & 4 deletions examples/solid/todo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"private": true,
"version": "0.0.35",
"dependencies": {
"@tanstack/electric-db-collection": "^0.3.8",
"@tanstack/electric-db-collection": "^0.3.9",
"@tanstack/query-core": "^5.90.20",
"@tanstack/query-db-collection": "^1.0.42",
"@tanstack/solid-db": "^0.2.24",
"@tanstack/query-db-collection": "^1.0.43",
"@tanstack/solid-db": "^0.2.25",
"@tanstack/solid-router": "^1.159.5",
"@tanstack/solid-start": "^1.159.5",
"@tanstack/trailbase-db-collection": "^0.1.88",
"@tanstack/trailbase-db-collection": "^0.1.89",
"cors": "^2.8.6",
"drizzle-orm": "^0.45.1",
"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.71

### Patch Changes

- Updated dependencies [[`d79b0cd`](https://github.com/TanStack/db/commit/d79b0cd3fd20c1f7e2525e90121752fb6bee314c), [`36fb29a`](https://github.com/TanStack/db/commit/36fb29ad7e906d39b6afdba2fd31e369c601bbb0), [`d79b0cd`](https://github.com/TanStack/db/commit/d79b0cd3fd20c1f7e2525e90121752fb6bee314c), [`ac09b11`](https://github.com/TanStack/db/commit/ac09b1177a100eafa85cba3cd09dd1f53f933ded)]:
- @tanstack/db@0.6.11

## 0.1.70

### 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,6 +1,6 @@
{
"name": "@tanstack/angular-db",
"version": "0.1.70",
"version": "0.1.71",
"description": "Angular integration for @tanstack/db",
"author": "Ethan McDaniel",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions packages/browser-db-sqlite-persistence/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/browser-db-sqlite-persistence

## 0.2.3

### Patch Changes

- Updated dependencies []:
- @tanstack/db-sqlite-persistence-core@0.2.3

## 0.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-db-sqlite-persistence/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/browser-db-sqlite-persistence",
"version": "0.2.2",
"version": "0.2.3",
"description": "Browser wa-sqlite persisted collection adapter for TanStack DB",
"author": "TanStack Team",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions packages/capacitor-db-sqlite-persistence/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/capacitor-db-sqlite-persistence

## 0.2.3

### Patch Changes

- Updated dependencies []:
- @tanstack/db-sqlite-persistence-core@0.2.3

## 0.2.2

### Patch Changes
Expand Down
8 changes: 8 additions & 0 deletions packages/capacitor-db-sqlite-persistence/e2e/app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @tanstack/capacitor-db-sqlite-persistence-e2e-app

## 0.0.15

### Patch Changes

- Updated dependencies [[`d79b0cd`](https://github.com/TanStack/db/commit/d79b0cd3fd20c1f7e2525e90121752fb6bee314c), [`36fb29a`](https://github.com/TanStack/db/commit/36fb29ad7e906d39b6afdba2fd31e369c601bbb0), [`d79b0cd`](https://github.com/TanStack/db/commit/d79b0cd3fd20c1f7e2525e90121752fb6bee314c), [`ac09b11`](https://github.com/TanStack/db/commit/ac09b1177a100eafa85cba3cd09dd1f53f933ded)]:
- @tanstack/db@0.6.11
- @tanstack/capacitor-db-sqlite-persistence@0.2.3

## 0.0.14

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/capacitor-db-sqlite-persistence-e2e-app",
"private": true,
"version": "0.0.14",
"version": "0.0.15",
"type": "module",
"scripts": {
"build": "vite build",
Expand Down
2 changes: 1 addition & 1 deletion packages/capacitor-db-sqlite-persistence/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/capacitor-db-sqlite-persistence",
"version": "0.2.2",
"version": "0.2.3",
"description": "Capacitor SQLite persisted collection adapter for TanStack DB",
"author": "TanStack Team",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/cloudflare-durable-objects-db-sqlite-persistence

## 0.2.3

### Patch Changes

- Updated dependencies []:
- @tanstack/db-sqlite-persistence-core@0.2.3

## 0.2.2

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/cloudflare-durable-objects-db-sqlite-persistence",
"version": "0.2.2",
"version": "0.2.3",
"description": "Cloudflare Durable Object SQLite persisted collection adapter for TanStack DB",
"author": "TanStack Team",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions packages/db-sqlite-persistence-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/db-sqlite-persistence-core

## 0.2.3

### Patch Changes

- Updated dependencies [[`d79b0cd`](https://github.com/TanStack/db/commit/d79b0cd3fd20c1f7e2525e90121752fb6bee314c), [`36fb29a`](https://github.com/TanStack/db/commit/36fb29ad7e906d39b6afdba2fd31e369c601bbb0), [`d79b0cd`](https://github.com/TanStack/db/commit/d79b0cd3fd20c1f7e2525e90121752fb6bee314c), [`ac09b11`](https://github.com/TanStack/db/commit/ac09b1177a100eafa85cba3cd09dd1f53f933ded)]:
- @tanstack/db@0.6.11

## 0.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/db-sqlite-persistence-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/db-sqlite-persistence-core",
"version": "0.2.2",
"version": "0.2.3",
"description": "SQLite persisted collection core for TanStack DB",
"author": "TanStack Team",
"license": "MIT",
Expand Down
34 changes: 34 additions & 0 deletions packages/db/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# @tanstack/db

## 0.6.11

### Patch Changes

- Fix incorrect results from index-optimized `where` clauses that combine indexed and non-indexed conditions. ([#1582](https://github.com/TanStack/db/pull/1582))
- `OR` expressions are now only served from indexes when every disjunct can use an index; otherwise the query falls back to a full scan. Previously, rows matched only by a non-indexed disjunct were missing from the result.
- `AND` expressions still use indexes for the conditions that have them, but the remaining conditions are now enforced by re-checking each candidate row against the full expression. Previously, non-indexed conditions were silently dropped, returning rows that did not match the query.
- Compound range conditions (e.g. `age > 5 AND age < 10`) combined with conditions on other fields no longer ignore those other conditions.
- Compound range conditions sharing the same boundary value (e.g. `age >= 5 AND age > 5`) now apply the strictest bound regardless of the order the conditions appear in, using the same value comparison semantics as the indexes (dates, locale strings, ...).
- Compound range conditions that only bound one side (e.g. `age > 5 AND age >= 8`) no longer return an empty result.
- Strict range comparisons (`gt`/`lt`) on BTree-indexed fields holding normalized values such as dates now correctly exclude the boundary value.
- Compound range conditions with a `null`/`undefined` bound (e.g. `gt(score, undefined)`) now re-filter against the full expression instead of returning index-ordered rows, matching the semantics of a full scan (a comparison against `null`/`undefined` is never true).
- Index-optimized `eq`, `IN`, and range queries on a field that has rows with `null`/`undefined` values no longer leak those rows into results. BTree indexes store and return such rows (they sort as the smallest key), but a comparison against `null`/`undefined` is never true, so these results are now re-filtered against the full expression to stay equivalent to a full scan.
- String range conditions (`gt`/`gte`/`lt`/`lte`) on a collection using locale string collation (the default) are no longer served by the index. The index orders strings with `localeCompare` while the `where` evaluator compares them with standard relational operators, so an index range lookup could omit matching rows; these conditions now fall back to a full scan.
- Range conditions whose operand is not ordered the same way by the index and the `where` evaluator (arrays, plain objects, Temporal values) now fall back to a full scan instead of using the index, which could otherwise omit matching rows.
- Range conditions on an index created with a custom comparator now fall back to a full scan, since the comparator's ordering may not match the `where` evaluator's relational operators.

- fix(query): drive lazy-join loading through the collection the join key resolves to ([#1614](https://github.com/TanStack/db/pull/1614))

When a subquery used in a JOIN clause selects its join key from a _joined_ source rather than from its own `from` clause, the lazy-join loader subscribed to the wrong inner source: it used the subquery's `from` alias while computing the index requirement against the collection the key actually resolves to. This produced a misleading `Join requires an index` warning naming an already-indexed collection and an unnecessary full-load fallback. `followRef` now reports the resolved source alias, so lazy loading subscribes to the correct collection and loads through its index.

- Adopt PostgreSQL float semantics for `NaN` in `where` clauses and ordering. ([#1582](https://github.com/TanStack/db/pull/1582))

`NaN` (and invalid `Date` values, whose timestamp is `NaN`) previously had no consistent order — `NaN === NaN` is `false` in JavaScript, so `NaN` compared unequal to everything and could not be sorted or indexed deterministically. Following PostgreSQL, `NaN` is now treated as **equal to itself** and **greater than every other non-null value**:
- `eq(row.value, NaN)` matches rows whose value is `NaN`; `inArray(row.value, [NaN, ...])` matches them too.
- Range comparisons treat `NaN` as the greatest value: `gt`/`gte` include it, `lt`/`lte` exclude it.
- Ordering by a field containing `NaN` is now deterministic, with `NaN` sorting last (and `null` still ordered by `NULLS FIRST`/`NULLS LAST`).

`null`/`undefined` are unaffected: they continue to use three-valued logic (a comparison with `null` yields `UNKNOWN`).

This makes results independent of whether a query is served from an index or a full scan.

- Fix prototype pollution via `select()` alias paths. Aliases were split on `.` and walked into the result object without sanitization, so a query like `select(() => ({ ['__proto__.polluted']: ... }))` (or any segment matching `__proto__`, `prototype`, or `constructor`) could mutate `Object.prototype`. The select compiler now rejects unsafe alias path segments with a new `UnsafeAliasPathError`. Fixes #1584. ([#1595](https://github.com/TanStack/db/pull/1595))

## 0.6.10

### 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,6 +1,6 @@
{
"name": "@tanstack/db",
"version": "0.6.10",
"version": "0.6.11",
"description": "A reactive client store for building super fast apps on sync",
"author": "Kyle Mathews",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions packages/electric-db-collection/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/electric-db-collection

## 0.3.9

### Patch Changes

- Updated dependencies [[`d79b0cd`](https://github.com/TanStack/db/commit/d79b0cd3fd20c1f7e2525e90121752fb6bee314c), [`36fb29a`](https://github.com/TanStack/db/commit/36fb29ad7e906d39b6afdba2fd31e369c601bbb0), [`d79b0cd`](https://github.com/TanStack/db/commit/d79b0cd3fd20c1f7e2525e90121752fb6bee314c), [`ac09b11`](https://github.com/TanStack/db/commit/ac09b1177a100eafa85cba3cd09dd1f53f933ded)]:
- @tanstack/db@0.6.11

## 0.3.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/electric-db-collection/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/electric-db-collection",
"version": "0.3.8",
"version": "0.3.9",
"description": "ElectricSQL collection for TanStack DB",
"author": "Kyle Mathews",
"license": "MIT",
Expand Down
Loading
Loading