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

compileExpression.md

27 lines679 Bytes

1---
2id: compileExpression
3title: compileExpression
4---
5​
6```ts
7function compileExpression(expr, isSingleRow): CompiledExpression | CompiledSingleRowExpression;
8```
9​
10Defined in: [packages/db/src/query/compiler/evaluators.ts:103](https://github.com/TanStack/db/blob/main/packages/db/src/query/compiler/evaluators.ts#L103)
11​
12Compiles an expression into an optimized evaluator function.
13This eliminates branching during evaluation by pre-compiling the expression structure.
14​
15## Parameters
16​
17### expr
18​
19[`BasicExpression`](../@tanstack/namespaces/IR/type-aliases/BasicExpression.md)
20​
21### isSingleRow
22​
23`boolean` = `false`
24​
25## Returns
26​
27`CompiledExpression` \| `CompiledSingleRowExpression`