Open History to see the last commit
1---
2id: compileQuery
3title: compileQuery
4---
5
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7
8# Function: compileQuery()
9
10```ts
11function compileQuery(
12 rawQuery,
13 inputs,
14 cache,
15 queryMapping): CompilationResult
16```
17
18Defined in: [packages/db/src/query/compiler/index.ts:46](https://github.com/TanStack/db/blob/main/packages/db/src/query/compiler/index.ts#L46)
19
20Compiles a query2 IR into a D2 pipeline
21
22## Parameters
23
24### rawQuery
25
26`QueryIR`
27
28The query IR to compile
29
30### inputs
31
32`Record`\<`string`, [`KeyedStream`](../../type-aliases/keyedstream.md)\>
33
34Mapping of collection names to input streams
35
36### cache
37
38`QueryCache` = `...`
39
40Optional cache for compiled subqueries (used internally for recursion)
41
42### queryMapping
43
44`QueryMapping` = `...`
45
46Optional mapping from optimized queries to original queries
47
48## Returns
49
50`CompilationResult`
51
52A CompilationResult with the pipeline and collection WHERE clauses