Skip to content
Open
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
8 changes: 4 additions & 4 deletions docs/reference/interfaces/Transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Array of new mutations to apply
commit(): Promise<Transaction<T>>;
```

Defined in: [packages/db/src/transactions.ts:481](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L481)
Defined in: [packages/db/src/transactions.ts:493](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L493)

Commit the transaction and execute the mutation function

Expand Down Expand Up @@ -228,7 +228,7 @@ console.log(tx.state) // "completed" or "failed"
compareCreatedAt(other): number;
```

Defined in: [packages/db/src/transactions.ts:535](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L535)
Defined in: [packages/db/src/transactions.ts:547](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L547)

Compare two transactions by their createdAt time and sequence number in order
to sort them in the order they were created.
Expand Down Expand Up @@ -331,7 +331,7 @@ await tx.commit()
rollback(config?): Transaction<T>;
```

Defined in: [packages/db/src/transactions.ts:398](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L398)
Defined in: [packages/db/src/transactions.ts:410](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L410)

Rollback the transaction and any conflicting transactions

Expand Down Expand Up @@ -418,7 +418,7 @@ Defined in: [packages/db/src/transactions.ts:239](https://github.com/TanStack/db
touchCollection(): void;
```

Defined in: [packages/db/src/transactions.ts:426](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L426)
Defined in: [packages/db/src/transactions.ts:438](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L438)

#### Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: queryCollectionOptions
function queryCollectionOptions<T, TQueryFn, TError, TQueryKey, TKey, TQueryData>(config): CollectionConfig<InferSchemaOutput<T>, TKey, T, QueryCollectionUtils<InferSchemaOutput<T>, TKey, InferSchemaInput<T>, TError>> & object;
```

Defined in: [packages/query-db-collection/src/query.ts:438](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L438)
Defined in: [packages/query-db-collection/src/query.ts:445](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L445)

Creates query collection options for use with a standard Collection.
This integrates TanStack Query with TanStack DB for automatic synchronization.
Expand Down Expand Up @@ -151,7 +151,7 @@ const todosCollection = createCollection(
function queryCollectionOptions<T, TQueryFn, TError, TQueryKey, TKey, TQueryData>(config): CollectionConfig<T, TKey, never, QueryCollectionUtils<T, TKey, T, TError>> & object;
```

Defined in: [packages/query-db-collection/src/query.ts:473](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L473)
Defined in: [packages/query-db-collection/src/query.ts:480](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L480)

Creates query collection options for use with a standard Collection.
This integrates TanStack Query with TanStack DB for automatic synchronization.
Expand Down Expand Up @@ -291,7 +291,7 @@ const todosCollection = createCollection(
function queryCollectionOptions<T, TError, TQueryKey, TKey>(config): CollectionConfig<InferSchemaOutput<T>, TKey, T, QueryCollectionUtils<InferSchemaOutput<T>, TKey, InferSchemaInput<T>, TError>> & object;
```

Defined in: [packages/query-db-collection/src/query.ts:506](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L506)
Defined in: [packages/query-db-collection/src/query.ts:513](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L513)

Creates query collection options for use with a standard Collection.
This integrates TanStack Query with TanStack DB for automatic synchronization.
Expand Down Expand Up @@ -423,7 +423,7 @@ const todosCollection = createCollection(
function queryCollectionOptions<T, TError, TQueryKey, TKey>(config): CollectionConfig<T, TKey, never, QueryCollectionUtils<T, TKey, T, TError>> & object;
```

Defined in: [packages/query-db-collection/src/query.ts:540](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L540)
Defined in: [packages/query-db-collection/src/query.ts:547](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L547)

Creates query collection options for use with a standard Collection.
This integrates TanStack Query with TanStack DB for automatic synchronization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: ApplyJoinOptionalityToMergedSchema
type ApplyJoinOptionalityToMergedSchema<TExistingSchema, TNewSchema, TJoinType, TFromSourceNames> = { [K in keyof TExistingSchema]: K extends TFromSourceNames ? TJoinType extends "right" | "full" ? TExistingSchema[K] | undefined : TExistingSchema[K] : TExistingSchema[K] } & { [K in keyof TNewSchema]: TJoinType extends "left" | "full" ? TNewSchema[K] | undefined : TNewSchema[K] };
```

Defined in: [packages/db/src/query/builder/types.ts:929](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L929)
Defined in: [packages/db/src/query/builder/types.ts:984](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L984)

ApplyJoinOptionalityToMergedSchema - Applies optionality rules when merging schemas

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/FunctionalHavingRow.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: FunctionalHavingRow
type FunctionalHavingRow<TContext> = TContext["schema"] & TContext["hasResult"] extends true ? object : object;
```

Defined in: [packages/db/src/query/builder/types.ts:589](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L589)
Defined in: [packages/db/src/query/builder/types.ts:640](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L640)

FunctionalHavingRow - Type for the row parameter in functional having callbacks

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/GetResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: GetResult
type GetResult<TContext> = Prettify<ResultValue<TContext>>;
```

Defined in: [packages/db/src/query/builder/types.ts:1043](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1043)
Defined in: [packages/db/src/query/builder/types.ts:1098](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1098)

## Type Parameters

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/GroupByCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: GroupByCallback
type GroupByCallback<TContext> = (refs) => any;
```

Defined in: [packages/db/src/query/builder/types.ts:552](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L552)
Defined in: [packages/db/src/query/builder/types.ts:603](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L603)

GroupByCallback - Type for groupBy clause callback functions

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/InferResultType.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: InferResultType
type InferResultType<TContext> = TContext extends SingleResult ? GetResult<TContext> | undefined : GetResult<TContext>[];
```

Defined in: [packages/db/src/query/builder/types.ts:955](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L955)
Defined in: [packages/db/src/query/builder/types.ts:1010](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1010)

Utility type to infer the query result size (single row or an array)

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/JoinOnCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: JoinOnCallback
type JoinOnCallback<TContext> = (refs) => any;
```

Defined in: [packages/db/src/query/builder/types.ts:568](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L568)
Defined in: [packages/db/src/query/builder/types.ts:619](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L619)

JoinOnCallback - Type for join condition callback functions

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/MergeContextForJoinCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: MergeContextForJoinCallback
type MergeContextForJoinCallback<TContext, TNewSchema> = object & PreserveHasResultFlag<TContext["hasResult"]> & PreserveUnionFromFlag<TContext["hasUnionFrom"]> & PreserveFromSourceNames<TContext["fromSourceNames"]>;
```

Defined in: [packages/db/src/query/builder/types.ts:1200](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1200)
Defined in: [packages/db/src/query/builder/types.ts:1255](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1255)

MergeContextForJoinCallback - Special context for join condition callbacks

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/MergeContextWithJoinType.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: MergeContextWithJoinType
type MergeContextWithJoinType<TContext, TNewSchema, TJoinType> = object & PreserveSingleResultFlag<TContext["singleResult"]> & PreserveHasResultFlag<TContext["hasResult"]> & PreserveUnionFromFlag<TContext["hasUnionFrom"]> & PreserveFromSourceNames<TContext["fromSourceNames"]>;
```

Defined in: [packages/db/src/query/builder/types.ts:871](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L871)
Defined in: [packages/db/src/query/builder/types.ts:926](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L926)

MergeContextWithJoinType - Creates a new context after a join operation

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/OrderByCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: OrderByCallback
type OrderByCallback<TContext> = (refs) => any;
```

Defined in: [packages/db/src/query/builder/types.ts:516](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L516)
Defined in: [packages/db/src/query/builder/types.ts:567](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L567)

OrderByCallback - Type for orderBy clause callback functions

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/Prettify.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: Prettify
type Prettify<T> = { [K in keyof T]: T[K] } & object;
```

Defined in: [packages/db/src/query/builder/types.ts:1242](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1242)
Defined in: [packages/db/src/query/builder/types.ts:1297](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1297)

Prettify - Utility type for clean IDE display

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/type-aliases/Ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: Ref
# Type Alias: Ref\<T, Nullable\>

```ts
type Ref<T, Nullable> = { [K in keyof T]: IsNonExactOptional<T[K]> extends true ? IsNonExactNullable<T[K]> extends true ? IsPlainObject<NonNullable<T[K]>> extends true ? Ref<NonNullable<T[K]>, Nullable> | undefined : RefLeaf<NonNullable<T[K]>, Nullable> | undefined : IsPlainObject<NonUndefined<T[K]>> extends true ? Ref<NonUndefined<T[K]>, Nullable> | undefined : RefLeaf<NonUndefined<T[K]>, Nullable> | undefined : IsNonExactNullable<T[K]> extends true ? IsPlainObject<NonNull<T[K]>> extends true ? Ref<NonNull<T[K]>, Nullable> | null : RefLeaf<NonNull<T[K]>, Nullable> | null : IsPlainObject<T[K]> extends true ? Ref<T[K], Nullable> : RefLeaf<T[K], Nullable> } & RefLeaf<T, Nullable> & VirtualPropsRef;
type Ref<T, Nullable> = T extends unknown ? RefBranch<T, Nullable> : never;
```

Defined in: [packages/db/src/query/builder/types.ts:773](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L773)
Defined in: [packages/db/src/query/builder/types.ts:824](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L824)

Ref - The user-facing ref interface for the query builder

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/RefsForContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: RefsForContext
type RefsForContext<TContext> = { [K in KeysOfUnion<RefsSchemaForContext<TContext>>]: IsNonExactOptional<ValueOfUnion<RefsSchemaForContext<TContext>, K>> extends true ? IsNonExactNullable<ValueOfUnion<RefsSchemaForContext<TContext>, K>> extends true ? RefForContextValue<NonNullable<ValueOfUnion<RefsSchemaForContext<TContext>, K>>, true> : RefForContextValue<NonUndefined<ValueOfUnion<RefsSchemaForContext<TContext>, K>>, true> : IsNonExactNullable<ValueOfUnion<RefsSchemaForContext<TContext>, K>> extends true ? RefForContextValue<NonNull<ValueOfUnion<RefsSchemaForContext<TContext>, K>>, true> : RefForContextValue<ValueOfUnion<RefsSchemaForContext<TContext>, K>> } & TContext["hasResult"] extends true ? object : object;
```

Defined in: [packages/db/src/query/builder/types.ts:623](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L623)
Defined in: [packages/db/src/query/builder/types.ts:674](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L674)

## Type Parameters

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/type-aliases/WithResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: WithResult
type WithResult<TContext, TResult> = Prettify<Omit<TContext, "result" | "hasResult"> & object>;
```

Defined in: [packages/db/src/query/builder/types.ts:1232](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1232)
Defined in: [packages/db/src/query/builder/types.ts:1287](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1287)

WithResult - Updates a context with a new result type after select()

Expand Down