Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

QueryBuilderError.md

228 lines4.7 KB

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