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

querycollectionutils.md

140 lines2.4 KB

1---
2id: QueryCollectionUtils
3title: QueryCollectionUtils
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8# Interface: QueryCollectionUtils\<TItem, TKey, TInsertInput\>
9​
10Defined in: [packages/query-db-collection/src/query.ts:256](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L256)
11​
12Write operation types for batch operations
13​
14## Extends
15​
16- `UtilsRecord`
17​
18## Type Parameters
19​
20• **TItem** *extends* `object` = `Record`\<`string`, `unknown`\>
21​
22• **TKey** *extends* `string` \| `number` = `string` \| `number`
23​
24• **TInsertInput** *extends* `object` = `TItem`
25​
26## Indexable
27​
28```ts
29[key: string]: Fn
30```
31​
32## Properties
33​
34### refetch
35​
36```ts
37refetch: RefetchFn;
38```
39​
40Defined in: [packages/query-db-collection/src/query.ts:261](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L261)
41​
42***
43​
44### writeBatch()
45​
46```ts
47writeBatch: (operations) => void;
48```
49​
50Defined in: [packages/query-db-collection/src/query.ts:266](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L266)
51​
52#### Parameters
53​
54##### operations
55​
56[`SyncOperation`](../../type-aliases/syncoperation.md)\<`TItem`, `TKey`, `TInsertInput`\>[]
57​
58#### Returns
59​
60`void`
61​
62***
63​
64### writeDelete()
65​
66```ts
67writeDelete: (keys) => void;
68```
69​
70Defined in: [packages/query-db-collection/src/query.ts:264](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L264)
71​
72#### Parameters
73​
74##### keys
75​
76`TKey` | `TKey`[]
77​
78#### Returns
79​
80`void`
81​
82***
83​
84### writeInsert()
85​
86```ts
87writeInsert: (data) => void;
88```
89​
90Defined in: [packages/query-db-collection/src/query.ts:262](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L262)
91​
92#### Parameters
93​
94##### data
95​
96`TInsertInput` | `TInsertInput`[]
97​
98#### Returns
99​
100`void`
101​
102***
103​
104### writeUpdate()
105​
106```ts
107writeUpdate: (updates) => void;
108```
109​
110Defined in: [packages/query-db-collection/src/query.ts:263](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L263)
111​
112#### Parameters
113​
114##### updates
115​
116`Partial`\<`TItem`\> | `Partial`\<`TItem`\>[]
117​
118#### Returns
119​
120`void`
121​
122***
123​
124### writeUpsert()
125​
126```ts
127writeUpsert: (data) => void;
128```
129​
130Defined in: [packages/query-db-collection/src/query.ts:265](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L265)
131​
132#### Parameters
133​
134##### data
135​
136`Partial`\<`TItem`\> | `Partial`\<`TItem`\>[]
137​
138#### Returns
139​
140`void`