Open History to see the last commit
1---
2id: SyncConfig
3title: SyncConfig
4---
5
6# Interface: SyncConfig\<T, TKey\>
7
8Defined in: [packages/db/src/types.ts:325](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L325)
9
10## Type Parameters
11
12### T
13
14`T` *extends* `object` = `Record`\<`string`, `unknown`\>
15
16### TKey
17
18`TKey` *extends* `string` \| `number` = `string` \| `number`
19
20## Properties
21
22### getSyncMetadata()?
23
24```ts
25optional getSyncMetadata: () => Record<string, unknown>;
26```
27
28Defined in: [packages/db/src/types.ts:347](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L347)
29
30Get the sync metadata for insert operations
31
32#### Returns
33
34`Record`\<`string`, `unknown`\>
35
36Record containing relation information
37
38***
39
40### rowUpdateMode?
41
42```ts
43optional rowUpdateMode: "full" | "partial";
44```
45
46Defined in: [packages/db/src/types.ts:356](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L356)
47
48The row update mode used to sync to the collection.
49
50#### Default
51
52`partial`
53
54#### Description
55
56- `partial`: Updates contain only the changes to the row.
57- `full`: Updates contain the entire row.
58
59***
60
61### sync()
62
63```ts
64sync: (params) =>
65 | void
66 | CleanupFn
67 | SyncConfigRes;
68```
69
70Defined in: [packages/db/src/types.ts:329](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L329)
71
72#### Parameters
73
74##### params
75
76###### begin
77
78(`options?`) => `void`
79
80Begin a new sync transaction.
81
82###### collection
83
84[`Collection`](Collection.md)\<`T`, `TKey`, `any`, `any`, `any`\>
85
86###### commit
87
88() => `void`
89
90###### markReady
91
92() => `void`
93
94###### truncate
95
96() => `void`
97
98###### write
99
100(`message`) => `void`
101
102#### Returns
103
104 \| `void`
105 \| [`CleanupFn`](../type-aliases/CleanupFn.md)
106 \| [`SyncConfigRes`](../type-aliases/SyncConfigRes.md)