Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ title: "@tanstack/db"
- [SyncMode](../type-aliases/SyncMode.md)
- [TransactionState](../type-aliases/TransactionState.md)
- [TransactionWithMutations](../type-aliases/TransactionWithMutations.md)
- [UnloadSubsetFn](../type-aliases/UnloadSubsetFn.md)
- [UpdateMutationFn](../type-aliases/UpdateMutationFn.md)
- [UpdateMutationFnParams](../type-aliases/UpdateMutationFnParams.md)
- [UtilsRecord](../type-aliases/UtilsRecord.md)
Expand Down
28 changes: 14 additions & 14 deletions docs/reference/interfaces/BaseCollectionConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: BaseCollectionConfig

# Interface: BaseCollectionConfig\<T, TKey, TSchema, TUtils, TReturn\>

Defined in: [packages/db/src/types.ts:435](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L435)
Defined in: [packages/db/src/types.ts:438](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L438)

## Extended by

Expand Down Expand Up @@ -42,7 +42,7 @@ Defined in: [packages/db/src/types.ts:435](https://github.com/TanStack/db/blob/m
optional autoIndex: "eager" | "off";
```

Defined in: [packages/db/src/types.ts:484](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L484)
Defined in: [packages/db/src/types.ts:487](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L487)

Auto-indexing mode for the collection.
When enabled, indexes will be automatically created for simple where expressions.
Expand All @@ -66,7 +66,7 @@ When enabled, indexes will be automatically created for simple where expressions
optional compare: (x, y) => number;
```

Defined in: [packages/db/src/types.ts:495](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L495)
Defined in: [packages/db/src/types.ts:498](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L498)

Optional function to compare two items.
This is used to order the items in the collection.
Expand Down Expand Up @@ -106,7 +106,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime()
optional defaultStringCollation: StringCollationConfig;
```

Defined in: [packages/db/src/types.ts:641](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L641)
Defined in: [packages/db/src/types.ts:644](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L644)

Specifies how to compare data in the collection.
This should be configured to match data ordering on the backend.
Expand All @@ -121,7 +121,7 @@ E.g., when using the Electric DB collection these options
optional gcTime: number;
```

Defined in: [packages/db/src/types.ts:464](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L464)
Defined in: [packages/db/src/types.ts:467](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L467)

Time in milliseconds after which the collection will be garbage collected
when it has no active subscribers. Defaults to 5 minutes (300000ms).
Expand All @@ -134,7 +134,7 @@ when it has no active subscribers. Defaults to 5 minutes (300000ms).
getKey: (item) => TKey;
```

Defined in: [packages/db/src/types.ts:459](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L459)
Defined in: [packages/db/src/types.ts:462](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L462)

Function to extract the ID from an object
This is required for update/delete operations which now only accept IDs
Expand Down Expand Up @@ -168,7 +168,7 @@ getKey: (item) => item.uuid
optional id: string;
```

Defined in: [packages/db/src/types.ts:448](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L448)
Defined in: [packages/db/src/types.ts:451](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L451)

***

Expand All @@ -178,7 +178,7 @@ Defined in: [packages/db/src/types.ts:448](https://github.com/TanStack/db/blob/m
optional onDelete: DeleteMutationFn<T, TKey, TUtils, TReturn>;
```

Defined in: [packages/db/src/types.ts:633](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L633)
Defined in: [packages/db/src/types.ts:636](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L636)

Optional asynchronous handler function called before a delete operation

Expand Down Expand Up @@ -242,7 +242,7 @@ onDelete: async ({ transaction, collection }) => {
optional onInsert: InsertMutationFn<T, TKey, TUtils, TReturn>;
```

Defined in: [packages/db/src/types.ts:546](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L546)
Defined in: [packages/db/src/types.ts:549](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L549)

Optional asynchronous handler function called before an insert operation

Expand Down Expand Up @@ -305,7 +305,7 @@ onInsert: async ({ transaction, collection }) => {
optional onUpdate: UpdateMutationFn<T, TKey, TUtils, TReturn>;
```

Defined in: [packages/db/src/types.ts:590](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L590)
Defined in: [packages/db/src/types.ts:593](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L593)

Optional asynchronous handler function called before an update operation

Expand Down Expand Up @@ -369,7 +369,7 @@ onUpdate: async ({ transaction, collection }) => {
optional schema: TSchema;
```

Defined in: [packages/db/src/types.ts:449](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L449)
Defined in: [packages/db/src/types.ts:452](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L452)

***

Expand All @@ -379,7 +379,7 @@ Defined in: [packages/db/src/types.ts:449](https://github.com/TanStack/db/blob/m
optional startSync: boolean;
```

Defined in: [packages/db/src/types.ts:475](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L475)
Defined in: [packages/db/src/types.ts:478](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L478)

Whether to eagerly start syncing on collection creation.
When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches.
Expand All @@ -402,7 +402,7 @@ false
optional syncMode: SyncMode;
```

Defined in: [packages/db/src/types.ts:504](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L504)
Defined in: [packages/db/src/types.ts:507](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L507)

The mode of sync to use for the collection.

Expand All @@ -424,4 +424,4 @@ The exact implementation of the sync mode is up to the sync implementation.
optional utils: TUtils;
```

Defined in: [packages/db/src/types.ts:643](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L643)
Defined in: [packages/db/src/types.ts:646](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L646)
12 changes: 6 additions & 6 deletions docs/reference/interfaces/ChangeMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: ChangeMessage

# Interface: ChangeMessage\<T, TKey\>

Defined in: [packages/db/src/types.ts:311](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L311)
Defined in: [packages/db/src/types.ts:314](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L314)

## Extended by

Expand All @@ -29,7 +29,7 @@ Defined in: [packages/db/src/types.ts:311](https://github.com/TanStack/db/blob/m
key: TKey;
```

Defined in: [packages/db/src/types.ts:315](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L315)
Defined in: [packages/db/src/types.ts:318](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L318)

***

Expand All @@ -39,7 +39,7 @@ Defined in: [packages/db/src/types.ts:315](https://github.com/TanStack/db/blob/m
optional metadata: Record<string, unknown>;
```

Defined in: [packages/db/src/types.ts:319](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L319)
Defined in: [packages/db/src/types.ts:322](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L322)

***

Expand All @@ -49,7 +49,7 @@ Defined in: [packages/db/src/types.ts:319](https://github.com/TanStack/db/blob/m
optional previousValue: T;
```

Defined in: [packages/db/src/types.ts:317](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L317)
Defined in: [packages/db/src/types.ts:320](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L320)

***

Expand All @@ -59,7 +59,7 @@ Defined in: [packages/db/src/types.ts:317](https://github.com/TanStack/db/blob/m
type: OperationType;
```

Defined in: [packages/db/src/types.ts:318](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L318)
Defined in: [packages/db/src/types.ts:321](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L321)

***

Expand All @@ -69,4 +69,4 @@ Defined in: [packages/db/src/types.ts:318](https://github.com/TanStack/db/blob/m
value: T;
```

Defined in: [packages/db/src/types.ts:316](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L316)
Defined in: [packages/db/src/types.ts:319](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L319)
30 changes: 15 additions & 15 deletions docs/reference/interfaces/CollectionConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: CollectionConfig

# Interface: CollectionConfig\<T, TKey, TSchema, TUtils\>

Defined in: [packages/db/src/types.ts:646](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L646)
Defined in: [packages/db/src/types.ts:649](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L649)

## Extends

Expand Down Expand Up @@ -37,7 +37,7 @@ Defined in: [packages/db/src/types.ts:646](https://github.com/TanStack/db/blob/m
optional autoIndex: "eager" | "off";
```

Defined in: [packages/db/src/types.ts:484](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L484)
Defined in: [packages/db/src/types.ts:487](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L487)

Auto-indexing mode for the collection.
When enabled, indexes will be automatically created for simple where expressions.
Expand Down Expand Up @@ -65,7 +65,7 @@ When enabled, indexes will be automatically created for simple where expressions
optional compare: (x, y) => number;
```

Defined in: [packages/db/src/types.ts:495](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L495)
Defined in: [packages/db/src/types.ts:498](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L498)

Optional function to compare two items.
This is used to order the items in the collection.
Expand Down Expand Up @@ -109,7 +109,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime()
optional defaultStringCollation: StringCollationConfig;
```

Defined in: [packages/db/src/types.ts:641](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L641)
Defined in: [packages/db/src/types.ts:644](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L644)

Specifies how to compare data in the collection.
This should be configured to match data ordering on the backend.
Expand All @@ -128,7 +128,7 @@ E.g., when using the Electric DB collection these options
optional gcTime: number;
```

Defined in: [packages/db/src/types.ts:464](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L464)
Defined in: [packages/db/src/types.ts:467](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L467)

Time in milliseconds after which the collection will be garbage collected
when it has no active subscribers. Defaults to 5 minutes (300000ms).
Expand All @@ -145,7 +145,7 @@ when it has no active subscribers. Defaults to 5 minutes (300000ms).
getKey: (item) => TKey;
```

Defined in: [packages/db/src/types.ts:459](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L459)
Defined in: [packages/db/src/types.ts:462](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L462)

Function to extract the ID from an object
This is required for update/delete operations which now only accept IDs
Expand Down Expand Up @@ -183,7 +183,7 @@ getKey: (item) => item.uuid
optional id: string;
```

Defined in: [packages/db/src/types.ts:448](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L448)
Defined in: [packages/db/src/types.ts:451](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L451)

#### Inherited from

Expand All @@ -197,7 +197,7 @@ Defined in: [packages/db/src/types.ts:448](https://github.com/TanStack/db/blob/m
optional onDelete: DeleteMutationFn<T, TKey, TUtils, any>;
```

Defined in: [packages/db/src/types.ts:633](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L633)
Defined in: [packages/db/src/types.ts:636](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L636)

Optional asynchronous handler function called before a delete operation

Expand Down Expand Up @@ -265,7 +265,7 @@ onDelete: async ({ transaction, collection }) => {
optional onInsert: InsertMutationFn<T, TKey, TUtils, any>;
```

Defined in: [packages/db/src/types.ts:546](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L546)
Defined in: [packages/db/src/types.ts:549](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L549)

Optional asynchronous handler function called before an insert operation

Expand Down Expand Up @@ -332,7 +332,7 @@ onInsert: async ({ transaction, collection }) => {
optional onUpdate: UpdateMutationFn<T, TKey, TUtils, any>;
```

Defined in: [packages/db/src/types.ts:590](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L590)
Defined in: [packages/db/src/types.ts:593](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L593)

Optional asynchronous handler function called before an update operation

Expand Down Expand Up @@ -400,7 +400,7 @@ onUpdate: async ({ transaction, collection }) => {
optional schema: TSchema;
```

Defined in: [packages/db/src/types.ts:449](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L449)
Defined in: [packages/db/src/types.ts:452](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L452)

#### Inherited from

Expand All @@ -414,7 +414,7 @@ Defined in: [packages/db/src/types.ts:449](https://github.com/TanStack/db/blob/m
optional startSync: boolean;
```

Defined in: [packages/db/src/types.ts:475](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L475)
Defined in: [packages/db/src/types.ts:478](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L478)

Whether to eagerly start syncing on collection creation.
When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches.
Expand All @@ -441,7 +441,7 @@ false
sync: SyncConfig<T, TKey>;
```

Defined in: [packages/db/src/types.ts:652](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L652)
Defined in: [packages/db/src/types.ts:655](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L655)

***

Expand All @@ -451,7 +451,7 @@ Defined in: [packages/db/src/types.ts:652](https://github.com/TanStack/db/blob/m
optional syncMode: SyncMode;
```

Defined in: [packages/db/src/types.ts:504](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L504)
Defined in: [packages/db/src/types.ts:507](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L507)

The mode of sync to use for the collection.

Expand All @@ -477,7 +477,7 @@ The exact implementation of the sync mode is up to the sync implementation.
optional utils: TUtils;
```

Defined in: [packages/db/src/types.ts:643](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L643)
Defined in: [packages/db/src/types.ts:646](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L646)

#### Inherited from

Expand Down
10 changes: 5 additions & 5 deletions docs/reference/interfaces/CurrentStateAsChangesOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: CurrentStateAsChangesOptions

# Interface: CurrentStateAsChangesOptions

Defined in: [packages/db/src/types.ts:736](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L736)
Defined in: [packages/db/src/types.ts:739](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L739)

Options for getting current state as changes

Expand All @@ -17,7 +17,7 @@ Options for getting current state as changes
optional limit: number;
```

Defined in: [packages/db/src/types.ts:740](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L740)
Defined in: [packages/db/src/types.ts:743](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L743)

***

Expand All @@ -27,7 +27,7 @@ Defined in: [packages/db/src/types.ts:740](https://github.com/TanStack/db/blob/m
optional optimizedOnly: boolean;
```

Defined in: [packages/db/src/types.ts:741](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L741)
Defined in: [packages/db/src/types.ts:744](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L744)

***

Expand All @@ -37,7 +37,7 @@ Defined in: [packages/db/src/types.ts:741](https://github.com/TanStack/db/blob/m
optional orderBy: OrderBy;
```

Defined in: [packages/db/src/types.ts:739](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L739)
Defined in: [packages/db/src/types.ts:742](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L742)

***

Expand All @@ -47,6 +47,6 @@ Defined in: [packages/db/src/types.ts:739](https://github.com/TanStack/db/blob/m
optional where: BasicExpression<boolean>;
```

Defined in: [packages/db/src/types.ts:738](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L738)
Defined in: [packages/db/src/types.ts:741](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L741)

Pre-compiled expression for filtering the current state
6 changes: 3 additions & 3 deletions docs/reference/interfaces/InsertConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: InsertConfig

# Interface: InsertConfig

Defined in: [packages/db/src/types.ts:353](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L353)
Defined in: [packages/db/src/types.ts:356](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L356)

## Properties

Expand All @@ -15,7 +15,7 @@ Defined in: [packages/db/src/types.ts:353](https://github.com/TanStack/db/blob/m
optional metadata: Record<string, unknown>;
```

Defined in: [packages/db/src/types.ts:354](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L354)
Defined in: [packages/db/src/types.ts:357](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L357)

***

Expand All @@ -25,6 +25,6 @@ Defined in: [packages/db/src/types.ts:354](https://github.com/TanStack/db/blob/m
optional optimistic: boolean;
```

Defined in: [packages/db/src/types.ts:356](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L356)
Defined in: [packages/db/src/types.ts:359](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L359)

Whether to apply optimistic updates immediately. Defaults to true.
Loading