Open History to see the last commit
1---
2id: WhereClauseConversionError
3title: WhereClauseConversionError
4---
5
6# Class: WhereClauseConversionError
7
8Defined in: [packages/db/src/errors.ts:702](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L702)
9
10Internal error when the query optimizer fails to convert a WHERE clause to a collection filter.
11
12## Extends
13
14- [`QueryOptimizerError`](QueryOptimizerError.md)
15
16## Constructors
17
18### Constructor
19
20```ts
21new WhereClauseConversionError(collectionId, alias): WhereClauseConversionError;
22```
23
24Defined in: [packages/db/src/errors.ts:703](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L703)
25
26#### Parameters
27
28##### collectionId
29
30`string`
31
32##### alias
33
34`string`
35
36#### Returns
37
38`WhereClauseConversionError`
39
40#### Overrides
41
42[`QueryOptimizerError`](QueryOptimizerError.md).[`constructor`](QueryOptimizerError.md#constructor)
43
44## Properties
45
46### cause?
47
48```ts
49optional cause: unknown;
50```
51
52Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:26
53
54#### Inherited from
55
56[`QueryOptimizerError`](QueryOptimizerError.md).[`cause`](QueryOptimizerError.md#cause)
57
58***
59
60### message
61
62```ts
63message: string;
64```
65
66Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1077
67
68#### Inherited from
69
70[`QueryOptimizerError`](QueryOptimizerError.md).[`message`](QueryOptimizerError.md#message)
71
72***
73
74### name
75
76```ts
77name: string;
78```
79
80Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1076
81
82#### Inherited from
83
84[`QueryOptimizerError`](QueryOptimizerError.md).[`name`](QueryOptimizerError.md#name)
85
86***
87
88### stack?
89
90```ts
91optional stack: string;
92```
93
94Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1078
95
96#### Inherited from
97
98[`QueryOptimizerError`](QueryOptimizerError.md).[`stack`](QueryOptimizerError.md#stack)
99
100***
101
102### stackTraceLimit
103
104```ts
105static stackTraceLimit: number;
106```
107
108Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:67
109
110The `Error.stackTraceLimit` property specifies the number of stack frames
111collected by a stack trace (whether generated by `new Error().stack` or
112`Error.captureStackTrace(obj)`).
113
114The default value is `10` but may be set to any valid JavaScript number. Changes
115will affect any stack trace captured _after_ the value has been changed.
116
117If set to a non-number value, or set to a negative number, stack traces will
118not capture any frames.
119
120#### Inherited from
121
122[`QueryOptimizerError`](QueryOptimizerError.md).[`stackTraceLimit`](QueryOptimizerError.md#stacktracelimit)
123
124## Methods
125
126### captureStackTrace()
127
128```ts
129static captureStackTrace(targetObject, constructorOpt?): void;
130```
131
132Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:51
133
134Creates a `.stack` property on `targetObject`, which when accessed returns
135a string representing the location in the code at which
136`Error.captureStackTrace()` was called.
137
138```js
139const myObject = {};
140Error.captureStackTrace(myObject);
141myObject.stack; // Similar to `new Error().stack`
142```
143
144The first line of the trace will be prefixed with
145`${myObject.name}: ${myObject.message}`.
146
147The optional `constructorOpt` argument accepts a function. If given, all frames
148above `constructorOpt`, including `constructorOpt`, will be omitted from the
149generated stack trace.
150
151The `constructorOpt` argument is useful for hiding implementation
152details of error generation from the user. For instance:
153
154```js
155function a() {
156 b();
157}
158
159function b() {
160 c();
161}
162
163function c() {
164 // Create an error without stack trace to avoid calculating the stack trace twice.
165 const { stackTraceLimit } = Error;
166 Error.stackTraceLimit = 0;
167 const error = new Error();
168 Error.stackTraceLimit = stackTraceLimit;
169
170 // Capture the stack trace above function b
171 Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
172 throw error;
173}
174
175a();
176```
177
178#### Parameters
179
180##### targetObject
181
182`object`
183
184##### constructorOpt?
185
186`Function`
187
188#### Returns
189
190`void`
191
192#### Inherited from
193
194[`QueryOptimizerError`](QueryOptimizerError.md).[`captureStackTrace`](QueryOptimizerError.md#capturestacktrace)
195
196***
197
198### prepareStackTrace()
199
200```ts
201static prepareStackTrace(err, stackTraces): any;
202```
203
204Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:55
205
206#### Parameters
207
208##### err
209
210`Error`
211
212##### stackTraces
213
214`CallSite`[]
215
216#### Returns
217
218`any`
219
220#### See
221
222https://v8.dev/docs/stack-trace-api#customizing-stack-traces
223
224#### Inherited from
225
226[`QueryOptimizerError`](QueryOptimizerError.md).[`prepareStackTrace`](QueryOptimizerError.md#preparestacktrace)