From 2168e3d99fb0ef7688ce901b72f3ce1606df8d39 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 31 Oct 2026 00:30:17 +0000 Subject: [PATCH] docs: regenerate API documentation --- docs/errors.md | 2 +- .../reference/functions/injectLiveQuery.md | 14 +- docs/framework/angular/reference/index.md | 2 +- .../interfaces/InjectLiveQueryFlags.md | 122 -------- .../interfaces/InjectLiveQueryResult.md | 146 +-------- .../InjectLiveQueryResultWithCollection.md | 146 +-------- ...veQueryResultWithSingleResultCollection.md | 146 +-------- .../InjectConditionalLiveQueryResult.md | 2 +- .../type-aliases/InjectLiveQueryFlags.md | 22 ++ .../reference/functions/useLiveQuery.md | 16 +- .../UseConditionalLiveQueryResult.md | 51 +-- .../interfaces/UseLiveQueryResult.md | 51 +-- .../ConditionalUseLiveQueryConfig.md | 2 +- .../type-aliases/UseLiveQueryConfig.md | 2 +- .../type-aliases/UseLiveQueryStatus.md | 2 +- .../functions/useLiveInfiniteQuery.md | 15 +- .../react/reference/functions/useLiveQuery.md | 290 +++--------------- .../functions/useLiveSuspenseQuery.md | 176 +---------- .../reference/functions/usePacedMutations.md | 2 +- .../ConditionalUseLiveQueryConfig.md | 2 +- .../UseLiveInfiniteQueryConfig.md | 10 +- .../UseLiveInfiniteQueryReturn.md | 2 +- ...seLiveInfiniteQueryReturnWithCollection.md | 156 +--------- .../type-aliases/UseLiveQueryConfig.md | 2 +- .../type-aliases/UseLiveQueryStatus.md | 2 +- .../solid/reference/functions/useLiveQuery.md | 30 +- .../reference/functions/useLiveQuery.md | 10 +- .../interfaces/UseLiveQueryReturn.md | 108 +------ .../UseLiveQueryReturnWithCollection.md | 100 +----- .../ConditionalUseLiveQueryReturn.md | 2 +- .../type-aliases/UseLiveQueryConfig.md | 2 +- .../functions/useLiveInfiniteQuery.md | 4 +- .../vue/reference/functions/useLiveQuery.md | 10 +- docs/framework/vue/reference/index.md | 2 +- .../interfaces/UseLiveInfiniteQueryReturn.md | 110 ++----- ...seLiveInfiniteQueryReturnWithCollection.md | 118 ++----- .../reference/interfaces/UseLiveQueryFlags.md | 110 ------- .../interfaces/UseLiveQueryReturn.md | 134 +------- .../UseLiveQueryReturnWithCollection.md | 136 +------- ...veQueryReturnWithSingleResultCollection.md | 136 +------- .../ConditionalUseLiveQueryReturn.md | 2 +- .../type-aliases/UseLiveQueryFlags.md | 20 ++ .../AggregateFunctionNotInSelectError.md | 4 +- .../CannotCombineEmptyExpressionListError.md | 4 +- docs/reference/classes/CollectionImpl.md | 106 +++---- .../classes/CollectionInputNotFoundError.md | 4 +- .../classes/CollectionPreloadAbortedError.md | 4 +- docs/reference/classes/DbClient.md | 87 +++--- .../classes/DebounceCallDroppedError.md | 4 +- .../classes/DeleteKeyNotFoundError.md | 4 +- .../classes/DistinctRequiresSelectError.md | 4 +- .../classes/DuplicateAliasInSubqueryError.md | 229 -------------- docs/reference/classes/DuplicateKeyError.md | 4 +- .../classes/DuplicateKeySyncError.md | 4 +- .../classes/DuplicateTransactionIdError.md | 4 +- .../classes/EmptyReferencePathError.md | 4 +- .../classes/FnSelectWithGroupByError.md | 4 +- docs/reference/classes/GroupByError.md | 4 +- .../classes/GroupingOperatorRequiredError.md | 4 +- .../classes/HavingRequiresGroupByError.md | 4 +- .../classes/IncludeOperatorRequiredError.md | 4 +- .../reference/classes/InvalidJoinCondition.md | 4 +- .../InvalidJoinConditionLeftSourceError.md | 4 +- .../InvalidJoinConditionRightSourceError.md | 4 +- .../InvalidJoinConditionSameSourceError.md | 4 +- ...InvalidJoinConditionSourceMismatchError.md | 4 +- docs/reference/classes/InvalidKeyError.md | 4 +- .../classes/InvalidPoolOptionError.md | 4 +- docs/reference/classes/InvalidSourceError.md | 4 +- .../classes/InvalidSourceTypeError.md | 4 +- .../classes/InvalidStorageDataFormatError.md | 4 +- .../InvalidStorageObjectFormatError.md | 4 +- .../classes/InvalidWhereExpressionError.md | 4 +- .../classes/JoinCollectionNotFoundError.md | 4 +- .../JoinConditionMustBeEqualityError.md | 4 +- docs/reference/classes/JoinError.md | 4 +- .../classes/KeyUpdateNotAllowedError.md | 4 +- .../classes/LimitOffsetRequireOrderByError.md | 4 +- .../LoadSubsetOperationAbortedError.md | 4 +- .../classes/LocalStorageCollectionError.md | 4 +- .../classes/MissingAliasInputsError.md | 4 +- .../classes/MissingDeleteHandlerError.md | 4 +- docs/reference/classes/MissingHandlerError.md | 4 +- .../classes/MissingInsertHandlerError.md | 4 +- .../classes/MissingMutationFunctionError.md | 4 +- .../classes/MissingUpdateArgumentError.md | 4 +- .../classes/MissingUpdateHandlerError.md | 4 +- .../classes/NoKeysPassedToDeleteError.md | 4 +- .../classes/NoKeysPassedToUpdateError.md | 4 +- .../NoPendingSyncTransactionCommitError.md | 4 +- .../NoPendingSyncTransactionWriteError.md | 4 +- ...NonAggregateExpressionNotInGroupByError.md | 4 +- .../classes/OnMutateMustBeSynchronousError.md | 4 +- .../classes/OnlyOneSourceAllowedError.md | 4 +- .../PacedTransactionManualCommitError.md | 4 +- docs/reference/classes/QueryBuilderError.md | 4 +- .../classes/QueryCompilationError.md | 5 +- .../classes/QueryMustHaveFromClauseError.md | 4 +- docs/reference/classes/QueryOptimizerError.md | 4 +- .../classes/QueueCapacityExceededError.md | 4 +- docs/reference/classes/QueueDisposedError.md | 4 +- docs/reference/classes/SerializationError.md | 4 +- .../classes/SetWindowFindOneLimitError.md | 4 +- .../classes/SetWindowReentrancyError.md | 4 +- .../classes/SetWindowRequiresOrderByError.md | 4 +- .../classes/SourceCollectionIdReuseError.md | 8 +- docs/reference/classes/StorageError.md | 4 +- .../classes/StorageKeyRequiredError.md | 4 +- .../SubQueryMustHaveFromClauseError.md | 4 +- docs/reference/classes/SyncCleanupError.md | 4 +- .../classes/SyncQueueInvariantError.md | 4 +- .../SyncRowReusedWithoutPreviousValueError.md | 4 +- .../classes/SyncTransactionAbortedError.md | 4 +- .../SyncTransactionAlreadyCommittedError.md | 4 +- ...ncTransactionAlreadyCommittedWriteError.md | 4 +- .../classes/ThrottleCallDroppedError.md | 4 +- ...ransactionAlreadyCompletedRollbackError.md | 4 +- docs/reference/classes/TransactionError.md | 4 +- .../TransactionNotPendingCommitError.md | 4 +- .../TransactionNotPendingMutateError.md | 4 +- docs/reference/classes/UndefinedKeyError.md | 4 +- .../classes/UnhashableQueryIRError.md | 8 +- .../classes/UnknownExpressionTypeError.md | 4 +- .../reference/classes/UnknownFunctionError.md | 4 +- .../UnknownHavingExpressionTypeError.md | 4 +- .../reference/classes/UnsafeAliasPathError.md | 4 +- .../UnsupportedAggregateFunctionError.md | 4 +- .../classes/UnsupportedFnSelectResultError.md | 4 +- .../classes/UnsupportedFromTypeError.md | 4 +- .../classes/UnsupportedJoinSourceTypeError.md | 4 +- .../classes/UnsupportedJoinTypeError.md | 4 +- .../UnsupportedRootScalarSelectError.md | 4 +- .../classes/UpdateKeyNotFoundError.md | 4 +- .../functions/convexCollectionOptions.md | 2 +- .../convexPaginatedCollectionOptions.md | 4 +- docs/reference/convex-db-collection/index.md | 1 + .../interfaces/ConvexCollectionUtils.md | 6 +- .../functions/convexOfflineMutation.md | 2 +- .../offline/variables/convexMutationCodec.md | 2 +- .../type-aliases/ConvexCollectionClient.md | 2 +- .../type-aliases/ConvexCollectionConfig.md | 4 +- .../ConvexPaginatedCollectionConfig.md | 10 +- .../type-aliases/ConvexQueryOrder.md | 39 +++ .../functions/electricCollectionOptions.md | 4 +- .../interfaces/ElectricCollectionConfig.md | 35 +-- .../interfaces/ElectricCollectionUtils.md | 6 +- .../type-aliases/AwaitTxIdFn.md | 8 +- .../type-aliases/Txid.md | 2 +- .../functions/bindLiveQueryWindow.md | 2 +- docs/reference/functions/collectionOptions.md | 10 +- docs/reference/functions/configPool.md | 2 +- docs/reference/functions/createEffect.md | 2 +- .../functions/createLiveQueryObserver.md | 2 +- .../createLiveQueryWindowController.md | 2 +- docs/reference/functions/createTransaction.md | 2 +- docs/reference/functions/deepEquals.md | 2 +- .../functions/equalPersistedSnapshotValues.md | 2 +- .../functions/fetchNextLiveQueryWindowPage.md | 2 +- .../functions/getActiveTransaction.md | 2 +- docs/reference/functions/getLiveQueryHash.md | 2 +- .../functions/getLiveQueryStatusFlags.md | 13 +- .../functions/getPreparedLiveQueryIdentity.md | 2 +- .../functions/getPreparedLiveQuerySources.md | 2 +- docs/reference/functions/hasVirtualProps.md | 8 +- .../functions/isCollectionOptions.md | 2 +- docs/reference/functions/isFailedStatus.md | 22 ++ .../functions/localOnlyCollectionOptions.md | 4 +- .../functions/prepareLiveQueryValue.md | 2 +- .../functions/readLiveQueryWindowPageShape.md | 2 +- .../functions/rejectLiveQueryInput.md | 2 +- .../functions/releaseDeferredOnReclaim.md | 2 +- docs/reference/functions/reportUncaught.md | 23 ++ docs/reference/functions/resetWarnings.md | 20 -- .../functions/resolveLiveQueryValue.md | 2 +- .../resumeDeferredLiveQueryCollections.md | 2 +- docs/reference/functions/toBoundaryError.md | 2 +- docs/reference/functions/warnOnce.md | 45 --- .../functions/withCollectionConfigFactory.md | 2 +- docs/reference/index.md | 7 +- .../interfaces/BaseCollectionConfig.md | 70 ++--- docs/reference/interfaces/ChangeMessage.md | 12 +- docs/reference/interfaces/Collection.md | 110 +++---- docs/reference/interfaces/CollectionConfig.md | 68 ++-- .../interfaces/CollectionDependent.md | 10 +- .../interfaces/CollectionErrorInfo.md | 16 +- docs/reference/interfaces/CollectionLike.md | 10 +- docs/reference/interfaces/Context.md | 24 +- .../CreateLiveQueryObserverOptions.md | 12 +- .../CreateLiveQueryWindowControllerOptions.md | 12 +- .../CurrentStateAsChangesOptions.md | 10 +- docs/reference/interfaces/Effect.md | 6 +- docs/reference/interfaces/EffectConfig.md | 22 +- docs/reference/interfaces/EffectContext.md | 6 +- docs/reference/interfaces/HealthNode.md | 24 +- docs/reference/interfaces/HealthProblem.md | 102 ++++++ .../interfaces/IndexedDBCollectionConfig.md | 64 ++-- docs/reference/interfaces/InsertConfig.md | 6 +- .../interfaces/LiveQueryCollectionConfig.md | 12 +- .../reference/interfaces/LiveQueryObserver.md | 16 +- .../reference/interfaces/LiveQuerySnapshot.md | 30 +- .../interfaces/LiveQueryStatusFlags.md | 44 ++- .../interfaces/LiveQueryWindowBinding.md | 22 +- .../interfaces/LiveQueryWindowController.md | 16 +- .../interfaces/LiveQueryWindowPageShape.md | 6 +- .../interfaces/LiveQueryWindowSnapshot.md | 36 +-- .../interfaces/LiveQueryWindowUpdate.md | 18 +- .../interfaces/LocalOnlyCollectionConfig.md | 54 ++-- .../interfaces/LocalOnlyCollectionUtils.md | 4 +- .../LocalStorageCollectionConfig.md | 64 ++-- docs/reference/interfaces/OperationConfig.md | 6 +- .../interfaces/SubscribeChangesOptions.md | 51 +-- .../SubscribeChangesSnapshotOptions.md | 49 +-- docs/reference/interfaces/SyncConfig.md | 45 +-- docs/reference/interfaces/SyncMetadataApi.md | 8 +- docs/reference/interfaces/Transaction.md | 91 +++--- docs/reference/interfaces/VirtualRowProps.md | 60 +--- .../classes/PowerSyncTransactor.md | 12 +- .../functions/queryCollectionOptions.md | 8 +- .../interfaces/QueryCollectionConfig.md | 117 +++++-- .../interfaces/QueryCollectionUtils.md | 24 +- .../functions/rxdbCollectionOptions.md | 2 +- .../ApplyJoinOptionalityToMergedSchema.md | 2 +- docs/reference/type-aliases/ChangeListener.md | 2 +- .../ChangeMessageOrDeleteKeyMessage.md | 2 +- docs/reference/type-aliases/ChangesPayload.md | 2 +- docs/reference/type-aliases/CleanupFn.md | 2 +- .../CollectionConfigSingleRowOption.md | 2 +- .../CollectionMaterializeOptions.md | 4 +- .../type-aliases/CollectionOptions.md | 2 +- .../type-aliases/CollectionStatus.md | 2 +- .../type-aliases/ContextFromSource.md | 10 +- .../type-aliases/ContextFromUnionBranches.md | 18 +- .../type-aliases/ContextFromUnionSource.md | 2 +- docs/reference/type-aliases/ContextSchema.md | 2 +- docs/reference/type-aliases/DbClientEvent.md | 2 +- .../type-aliases/DbClientLiveQuery.md | 16 +- .../type-aliases/DbClientLiveQueryState.md | 2 +- .../reference/type-aliases/DbClientOptions.md | 2 +- .../DeferredLiveQueryCollections.md | 2 +- .../type-aliases/DehydrateDbClientOptions.md | 6 +- .../type-aliases/DehydratedCollectionChunk.md | 8 +- .../type-aliases/DehydratedCollectionRow.md | 8 +- .../type-aliases/DehydratedDbState.md | 6 +- .../type-aliases/DehydratedLiveQuery.md | 12 +- .../type-aliases/DehydratedLiveQueryResult.md | 6 +- .../type-aliases/DeleteKeyMessage.md | 2 +- .../type-aliases/DeleteMutationFn.md | 12 +- .../type-aliases/DeleteMutationFnParams.md | 6 +- docs/reference/type-aliases/DeltaEvent.md | 2 +- docs/reference/type-aliases/DeltaType.md | 2 +- .../type-aliases/EffectQueryInput.md | 2 +- .../type-aliases/FunctionalHavingRow.md | 2 +- docs/reference/type-aliases/GetResult.md | 2 +- .../reference/type-aliases/GroupByCallback.md | 2 +- .../type-aliases/InferCollectionType.md | 2 +- .../reference/type-aliases/InferResultType.md | 2 +- docs/reference/type-aliases/InputRow.md | 2 +- .../type-aliases/InsertMutationFn.md | 12 +- .../type-aliases/InsertMutationFnParams.md | 6 +- docs/reference/type-aliases/JoinOnCallback.md | 2 +- .../type-aliases/KeyedNamespacedRow.md | 2 +- docs/reference/type-aliases/KeyedStream.md | 2 +- .../type-aliases/LiveQueryCollectionUtils.md | 2 +- docs/reference/type-aliases/LiveQueryKey.md | 2 +- .../type-aliases/LiveQueryObserverListener.md | 2 +- .../type-aliases/LiveQueryOptions.md | 2 +- .../type-aliases/LiveQueryWindowRecompile.md | 6 +- docs/reference/type-aliases/LoadSubsetFn.md | 9 +- docs/reference/type-aliases/MakeOptional.md | 2 +- .../type-aliases/MaybeSingleResult.md | 4 +- .../MergeContextForJoinCallback.md | 2 +- .../type-aliases/MergeContextWithJoinType.md | 2 +- .../type-aliases/NamespacedAndKeyedStream.md | 2 +- docs/reference/type-aliases/NamespacedRow.md | 2 +- .../reference/type-aliases/NonSingleResult.md | 4 +- .../type-aliases/OperatorCallback.md | 2 +- .../type-aliases/OptimisticChangeMessage.md | 2 +- .../reference/type-aliases/OrderByCallback.md | 2 +- .../type-aliases/PooledLiveQueries.md | 2 +- docs/reference/type-aliases/Prettify.md | 2 +- docs/reference/type-aliases/Ref.md | 2 +- docs/reference/type-aliases/RefsForContext.md | 2 +- docs/reference/type-aliases/ResultStream.md | 2 +- .../type-aliases/ResultTypeFromSelect.md | 2 +- .../type-aliases/SchemaFromSource.md | 2 +- docs/reference/type-aliases/SelectObject.md | 2 +- docs/reference/type-aliases/SingleResult.md | 4 +- docs/reference/type-aliases/SingleSource.md | 2 +- docs/reference/type-aliases/Source.md | 2 +- .../type-aliases/SourceClauseContext.md | 2 +- docs/reference/type-aliases/StandardSchema.md | 2 +- .../type-aliases/StandardSchemaAlias.md | 2 +- .../type-aliases/SyncAppliedReceipt.md | 2 +- docs/reference/type-aliases/SyncConfigRes.md | 10 +- docs/reference/type-aliases/SyncMode.md | 2 +- .../SyncPersistenceCapabilityV1.md | 81 ++++- .../SyncPersistenceKeySetEvidence.md | 4 +- .../SyncPersistenceScanOptions.md | 4 +- .../type-aliases/SyncPersistenceScannedRow.md | 8 +- docs/reference/type-aliases/UnloadSubsetFn.md | 2 +- .../type-aliases/UpdateMutationFn.md | 12 +- .../type-aliases/UpdateMutationFnParams.md | 6 +- docs/reference/type-aliases/WhereCallback.md | 2 +- docs/reference/type-aliases/WithResult.md | 2 +- .../type-aliases/WithVirtualProps.md | 7 +- .../type-aliases/WithoutVirtualProps.md | 2 +- docs/reference/type-aliases/WritableDeep.md | 2 +- docs/reference/variables/pooledLiveQueries.md | 2 +- .../variables/syncWriteNamesWholeRow.md | 16 + 309 files changed, 1738 insertions(+), 3589 deletions(-) delete mode 100644 docs/framework/angular/reference/interfaces/InjectLiveQueryFlags.md create mode 100644 docs/framework/angular/reference/type-aliases/InjectLiveQueryFlags.md delete mode 100644 docs/framework/vue/reference/interfaces/UseLiveQueryFlags.md create mode 100644 docs/framework/vue/reference/type-aliases/UseLiveQueryFlags.md delete mode 100644 docs/reference/classes/DuplicateAliasInSubqueryError.md create mode 100644 docs/reference/convex-db-collection/type-aliases/ConvexQueryOrder.md create mode 100644 docs/reference/functions/isFailedStatus.md create mode 100644 docs/reference/functions/reportUncaught.md delete mode 100644 docs/reference/functions/resetWarnings.md delete mode 100644 docs/reference/functions/warnOnce.md create mode 100644 docs/reference/interfaces/HealthProblem.md create mode 100644 docs/reference/variables/syncWriteNamesWholeRow.md diff --git a/docs/errors.md b/docs/errors.md index e6b90fc583..32e60566a8 100644 --- a/docs/errors.md +++ b/docs/errors.md @@ -2447,7 +2447,7 @@ Development builds show this message, with `${...}` replaced by values: Development builds show this message, with `${...}` replaced by values: ```text -DbClient cannot reuse live query "${queryHash}" with different source Collections. Use the same Collection objects or a distinct query key. +DbClient cannot reuse live query "${queryHash}" with different source Collections or getKey/schema options. Use the same Collection objects and options, or a distinct query key. ``` diff --git a/docs/framework/angular/reference/functions/injectLiveQuery.md b/docs/framework/angular/reference/functions/injectLiveQuery.md index d45309c46b..0b77241d31 100644 --- a/docs/framework/angular/reference/functions/injectLiveQuery.md +++ b/docs/framework/angular/reference/functions/injectLiveQuery.md @@ -9,7 +9,7 @@ title: injectLiveQuery function injectLiveQuery(options): InjectLiveQueryResult; ``` -Defined in: [angular-db/src/index.ts:112](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L112) +Defined in: [angular-db/src/index.ts:100](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L100) ### Type Parameters @@ -50,7 +50,7 @@ Pass `pooledLiveQueries` to share one partition among equal-shape queries. function injectLiveQuery(options): InjectConditionalLiveQueryResult; ``` -Defined in: [angular-db/src/index.ts:124](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L124) +Defined in: [angular-db/src/index.ts:112](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L112) ### Type Parameters @@ -91,7 +91,7 @@ Pass `pooledLiveQueries` to share one partition among equal-shape queries. function injectLiveQuery(queryFn): InjectLiveQueryResult; ``` -Defined in: [angular-db/src/index.ts:136](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L136) +Defined in: [angular-db/src/index.ts:124](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L124) ### Type Parameters @@ -115,7 +115,7 @@ Defined in: [angular-db/src/index.ts:136](https://github.com/TanStack/db/blob/ma function injectLiveQuery(queryFn): InjectConditionalLiveQueryResult; ``` -Defined in: [angular-db/src/index.ts:139](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L139) +Defined in: [angular-db/src/index.ts:127](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L127) ### Type Parameters @@ -139,7 +139,7 @@ Defined in: [angular-db/src/index.ts:139](https://github.com/TanStack/db/blob/ma function injectLiveQuery(config): InjectLiveQueryResult; ``` -Defined in: [angular-db/src/index.ts:144](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L144) +Defined in: [angular-db/src/index.ts:132](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L132) ### Type Parameters @@ -163,7 +163,7 @@ Defined in: [angular-db/src/index.ts:144](https://github.com/TanStack/db/blob/ma function injectLiveQuery(liveQueryCollection): InjectLiveQueryResultWithCollection; ``` -Defined in: [angular-db/src/index.ts:148](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L148) +Defined in: [angular-db/src/index.ts:136](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L136) ### Type Parameters @@ -195,7 +195,7 @@ Defined in: [angular-db/src/index.ts:148](https://github.com/TanStack/db/blob/ma function injectLiveQuery(liveQueryCollection): InjectLiveQueryResultWithSingleResultCollection; ``` -Defined in: [angular-db/src/index.ts:156](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L156) +Defined in: [angular-db/src/index.ts:144](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L144) ### Type Parameters diff --git a/docs/framework/angular/reference/index.md b/docs/framework/angular/reference/index.md index 33f0f1ce56..098f4e35a3 100644 --- a/docs/framework/angular/reference/index.md +++ b/docs/framework/angular/reference/index.md @@ -5,7 +5,6 @@ title: "@tanstack/angular-db" ## Interfaces -- [InjectLiveQueryFlags](interfaces/InjectLiveQueryFlags.md) - [InjectLiveQueryResult](interfaces/InjectLiveQueryResult.md) - [InjectLiveQueryResultWithCollection](interfaces/InjectLiveQueryResultWithCollection.md) - [InjectLiveQueryResultWithSingleResultCollection](interfaces/InjectLiveQueryResultWithSingleResultCollection.md) @@ -13,6 +12,7 @@ title: "@tanstack/angular-db" ## Type Aliases - [InjectConditionalLiveQueryResult](type-aliases/InjectConditionalLiveQueryResult.md) +- [InjectLiveQueryFlags](type-aliases/InjectLiveQueryFlags.md) ## Functions diff --git a/docs/framework/angular/reference/interfaces/InjectLiveQueryFlags.md b/docs/framework/angular/reference/interfaces/InjectLiveQueryFlags.md deleted file mode 100644 index d6aa51020f..0000000000 --- a/docs/framework/angular/reference/interfaces/InjectLiveQueryFlags.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -id: InjectLiveQueryFlags -title: InjectLiveQueryFlags ---- - -Defined in: [angular-db/src/index.ts:44](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L44) - -Status, persistence, and health signals every `injectLiveQuery` result has. - -## Extended by - -- [`InjectLiveQueryResult`](InjectLiveQueryResult.md) -- [`InjectLiveQueryResultWithCollection`](InjectLiveQueryResultWithCollection.md) -- [`InjectLiveQueryResultWithSingleResultCollection`](InjectLiveQueryResultWithSingleResultCollection.md) - -## Properties - -### health - -```ts -health: Signal; -``` - -Defined in: [angular-db/src/index.ts:62](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L62) - -A signal containing the health tree for the query and its dependencies - -*** - -### isCleanedUp - -```ts -isCleanedUp: Signal; -``` - -Defined in: [angular-db/src/index.ts:58](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L58) - -A signal indicating whether the collection has been cleaned up - -*** - -### isCrashed - -```ts -isCrashed: Signal; -``` - -Defined in: [angular-db/src/index.ts:56](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L56) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. - -*** - -### isIdle - -```ts -isIdle: Signal; -``` - -Defined in: [angular-db/src/index.ts:52](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L52) - -A signal indicating whether the collection is idle - -*** - -### isLoading - -```ts -isLoading: Signal; -``` - -Defined in: [angular-db/src/index.ts:48](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L48) - -A signal indicating whether the collection is currently loading - -*** - -### isLoadingError - -```ts -isLoadingError: Signal; -``` - -Defined in: [angular-db/src/index.ts:54](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L54) - -The first load failed: there is nothing to show. - -*** - -### isReady - -```ts -isReady: Signal; -``` - -Defined in: [angular-db/src/index.ts:50](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L50) - -A signal indicating whether the collection is ready - -*** - -### isSyncError - -```ts -isSyncError: Signal; -``` - -Defined in: [angular-db/src/index.ts:60](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L60) - -The data is shown, and a sync problem or failed request is in `health`. - -*** - -### status - -```ts -status: Signal; -``` - -Defined in: [angular-db/src/index.ts:46](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L46) - -A signal containing the current status of the collection diff --git a/docs/framework/angular/reference/interfaces/InjectLiveQueryResult.md b/docs/framework/angular/reference/interfaces/InjectLiveQueryResult.md index 7738bfb842..dd10a8e88c 100644 --- a/docs/framework/angular/reference/interfaces/InjectLiveQueryResult.md +++ b/docs/framework/angular/reference/interfaces/InjectLiveQueryResult.md @@ -3,13 +3,13 @@ id: InjectLiveQueryResult title: InjectLiveQueryResult --- -Defined in: [angular-db/src/index.ts:65](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L65) +Defined in: [angular-db/src/index.ts:53](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L53) -Status, persistence, and health signals every `injectLiveQuery` result has. +The status and flag signals every `injectLiveQuery` result has. ## Extends -- [`InjectLiveQueryFlags`](InjectLiveQueryFlags.md) +- [`InjectLiveQueryFlags`](../type-aliases/InjectLiveQueryFlags.md) ## Type Parameters @@ -28,7 +28,7 @@ collection: Signal< | null>; ``` -Defined in: [angular-db/src/index.ts:73](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L73) +Defined in: [angular-db/src/index.ts:61](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L61) A signal containing the underlying collection instance (null for disabled queries) @@ -40,147 +40,19 @@ A signal containing the underlying collection instance (null for disabled querie data: Signal>; ``` -Defined in: [angular-db/src/index.ts:71](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L71) +Defined in: [angular-db/src/index.ts:59](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L59) A signal containing the results as an array, or single result for findOne queries *** -### health - -```ts -health: Signal; -``` - -Defined in: [angular-db/src/index.ts:62](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L62) - -A signal containing the health tree for the query and its dependencies - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`health`](InjectLiveQueryFlags.md#health) - -*** - -### isCleanedUp - -```ts -isCleanedUp: Signal; -``` - -Defined in: [angular-db/src/index.ts:58](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L58) - -A signal indicating whether the collection has been cleaned up - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isCleanedUp`](InjectLiveQueryFlags.md#iscleanedup) - -*** - -### isCrashed - -```ts -isCrashed: Signal; -``` - -Defined in: [angular-db/src/index.ts:56](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L56) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isCrashed`](InjectLiveQueryFlags.md#iscrashed) - -*** - -### isIdle - -```ts -isIdle: Signal; -``` - -Defined in: [angular-db/src/index.ts:52](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L52) - -A signal indicating whether the collection is idle - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isIdle`](InjectLiveQueryFlags.md#isidle) - -*** - -### isLoading - -```ts -isLoading: Signal; -``` - -Defined in: [angular-db/src/index.ts:48](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L48) - -A signal indicating whether the collection is currently loading - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isLoading`](InjectLiveQueryFlags.md#isloading) - -*** - -### isLoadingError - -```ts -isLoadingError: Signal; -``` - -Defined in: [angular-db/src/index.ts:54](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L54) - -The first load failed: there is nothing to show. - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isLoadingError`](InjectLiveQueryFlags.md#isloadingerror) - -*** - -### isReady - -```ts -isReady: Signal; -``` - -Defined in: [angular-db/src/index.ts:50](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L50) - -A signal indicating whether the collection is ready - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isReady`](InjectLiveQueryFlags.md#isready) - -*** - -### isSyncError - -```ts -isSyncError: Signal; -``` - -Defined in: [angular-db/src/index.ts:60](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L60) - -The data is shown, and a sync problem or failed request is in `health`. - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isSyncError`](InjectLiveQueryFlags.md#issyncerror) - -*** - ### state ```ts state: Signal[K] }>>; ``` -Defined in: [angular-db/src/index.ts:69](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L69) +Defined in: [angular-db/src/index.ts:57](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L57) A signal containing the complete state map of results keyed by their ID @@ -192,10 +64,12 @@ A signal containing the complete state map of results keyed by their ID status: Signal; ``` -Defined in: [angular-db/src/index.ts:46](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L46) +Defined in: [angular-db/src/index.ts:48](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L48) A signal containing the current status of the collection #### Inherited from -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`status`](InjectLiveQueryFlags.md#status) +```ts +InjectLiveQueryFlags.status +``` diff --git a/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithCollection.md b/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithCollection.md index 0b7e486571..a31d579a17 100644 --- a/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithCollection.md +++ b/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithCollection.md @@ -3,13 +3,13 @@ id: InjectLiveQueryResultWithCollection title: InjectLiveQueryResultWithCollection --- -Defined in: [angular-db/src/index.ts:92](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L92) +Defined in: [angular-db/src/index.ts:80](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L80) -Status, persistence, and health signals every `injectLiveQuery` result has. +The status and flag signals every `injectLiveQuery` result has. ## Extends -- [`InjectLiveQueryFlags`](InjectLiveQueryFlags.md) +- [`InjectLiveQueryFlags`](../type-aliases/InjectLiveQueryFlags.md) ## Type Parameters @@ -36,7 +36,7 @@ collection: Signal< | null>; ``` -Defined in: [angular-db/src/index.ts:99](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L99) +Defined in: [angular-db/src/index.ts:87](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L87) *** @@ -46,135 +46,7 @@ Defined in: [angular-db/src/index.ts:99](https://github.com/TanStack/db/blob/mai data: Signal; ``` -Defined in: [angular-db/src/index.ts:98](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L98) - -*** - -### health - -```ts -health: Signal; -``` - -Defined in: [angular-db/src/index.ts:62](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L62) - -A signal containing the health tree for the query and its dependencies - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`health`](InjectLiveQueryFlags.md#health) - -*** - -### isCleanedUp - -```ts -isCleanedUp: Signal; -``` - -Defined in: [angular-db/src/index.ts:58](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L58) - -A signal indicating whether the collection has been cleaned up - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isCleanedUp`](InjectLiveQueryFlags.md#iscleanedup) - -*** - -### isCrashed - -```ts -isCrashed: Signal; -``` - -Defined in: [angular-db/src/index.ts:56](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L56) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isCrashed`](InjectLiveQueryFlags.md#iscrashed) - -*** - -### isIdle - -```ts -isIdle: Signal; -``` - -Defined in: [angular-db/src/index.ts:52](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L52) - -A signal indicating whether the collection is idle - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isIdle`](InjectLiveQueryFlags.md#isidle) - -*** - -### isLoading - -```ts -isLoading: Signal; -``` - -Defined in: [angular-db/src/index.ts:48](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L48) - -A signal indicating whether the collection is currently loading - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isLoading`](InjectLiveQueryFlags.md#isloading) - -*** - -### isLoadingError - -```ts -isLoadingError: Signal; -``` - -Defined in: [angular-db/src/index.ts:54](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L54) - -The first load failed: there is nothing to show. - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isLoadingError`](InjectLiveQueryFlags.md#isloadingerror) - -*** - -### isReady - -```ts -isReady: Signal; -``` - -Defined in: [angular-db/src/index.ts:50](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L50) - -A signal indicating whether the collection is ready - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isReady`](InjectLiveQueryFlags.md#isready) - -*** - -### isSyncError - -```ts -isSyncError: Signal; -``` - -Defined in: [angular-db/src/index.ts:60](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L60) - -The data is shown, and a sync problem or failed request is in `health`. - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isSyncError`](InjectLiveQueryFlags.md#issyncerror) +Defined in: [angular-db/src/index.ts:86](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L86) *** @@ -184,7 +56,7 @@ The data is shown, and a sync problem or failed request is in `health`. state: Signal>; ``` -Defined in: [angular-db/src/index.ts:97](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L97) +Defined in: [angular-db/src/index.ts:85](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L85) *** @@ -194,10 +66,12 @@ Defined in: [angular-db/src/index.ts:97](https://github.com/TanStack/db/blob/mai status: Signal; ``` -Defined in: [angular-db/src/index.ts:46](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L46) +Defined in: [angular-db/src/index.ts:48](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L48) A signal containing the current status of the collection #### Inherited from -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`status`](InjectLiveQueryFlags.md#status) +```ts +InjectLiveQueryFlags.status +``` diff --git a/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithSingleResultCollection.md b/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithSingleResultCollection.md index 40bd02aa6e..0e3f0674ba 100644 --- a/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithSingleResultCollection.md +++ b/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithSingleResultCollection.md @@ -3,13 +3,13 @@ id: InjectLiveQueryResultWithSingleResultCollection title: InjectLiveQueryResultWithSingleResultCollection --- -Defined in: [angular-db/src/index.ts:102](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L102) +Defined in: [angular-db/src/index.ts:90](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L90) -Status, persistence, and health signals every `injectLiveQuery` result has. +The status and flag signals every `injectLiveQuery` result has. ## Extends -- [`InjectLiveQueryFlags`](InjectLiveQueryFlags.md) +- [`InjectLiveQueryFlags`](../type-aliases/InjectLiveQueryFlags.md) ## Type Parameters @@ -36,7 +36,7 @@ collection: Signal< | null>; ``` -Defined in: [angular-db/src/index.ts:109](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L109) +Defined in: [angular-db/src/index.ts:97](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L97) *** @@ -46,135 +46,7 @@ Defined in: [angular-db/src/index.ts:109](https://github.com/TanStack/db/blob/ma data: Signal; ``` -Defined in: [angular-db/src/index.ts:108](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L108) - -*** - -### health - -```ts -health: Signal; -``` - -Defined in: [angular-db/src/index.ts:62](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L62) - -A signal containing the health tree for the query and its dependencies - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`health`](InjectLiveQueryFlags.md#health) - -*** - -### isCleanedUp - -```ts -isCleanedUp: Signal; -``` - -Defined in: [angular-db/src/index.ts:58](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L58) - -A signal indicating whether the collection has been cleaned up - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isCleanedUp`](InjectLiveQueryFlags.md#iscleanedup) - -*** - -### isCrashed - -```ts -isCrashed: Signal; -``` - -Defined in: [angular-db/src/index.ts:56](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L56) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isCrashed`](InjectLiveQueryFlags.md#iscrashed) - -*** - -### isIdle - -```ts -isIdle: Signal; -``` - -Defined in: [angular-db/src/index.ts:52](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L52) - -A signal indicating whether the collection is idle - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isIdle`](InjectLiveQueryFlags.md#isidle) - -*** - -### isLoading - -```ts -isLoading: Signal; -``` - -Defined in: [angular-db/src/index.ts:48](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L48) - -A signal indicating whether the collection is currently loading - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isLoading`](InjectLiveQueryFlags.md#isloading) - -*** - -### isLoadingError - -```ts -isLoadingError: Signal; -``` - -Defined in: [angular-db/src/index.ts:54](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L54) - -The first load failed: there is nothing to show. - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isLoadingError`](InjectLiveQueryFlags.md#isloadingerror) - -*** - -### isReady - -```ts -isReady: Signal; -``` - -Defined in: [angular-db/src/index.ts:50](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L50) - -A signal indicating whether the collection is ready - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isReady`](InjectLiveQueryFlags.md#isready) - -*** - -### isSyncError - -```ts -isSyncError: Signal; -``` - -Defined in: [angular-db/src/index.ts:60](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L60) - -The data is shown, and a sync problem or failed request is in `health`. - -#### Inherited from - -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`isSyncError`](InjectLiveQueryFlags.md#issyncerror) +Defined in: [angular-db/src/index.ts:96](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L96) *** @@ -184,7 +56,7 @@ The data is shown, and a sync problem or failed request is in `health`. state: Signal>; ``` -Defined in: [angular-db/src/index.ts:107](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L107) +Defined in: [angular-db/src/index.ts:95](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L95) *** @@ -194,10 +66,12 @@ Defined in: [angular-db/src/index.ts:107](https://github.com/TanStack/db/blob/ma status: Signal; ``` -Defined in: [angular-db/src/index.ts:46](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L46) +Defined in: [angular-db/src/index.ts:48](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L48) A signal containing the current status of the collection #### Inherited from -[`InjectLiveQueryFlags`](InjectLiveQueryFlags.md).[`status`](InjectLiveQueryFlags.md#status) +```ts +InjectLiveQueryFlags.status +``` diff --git a/docs/framework/angular/reference/type-aliases/InjectConditionalLiveQueryResult.md b/docs/framework/angular/reference/type-aliases/InjectConditionalLiveQueryResult.md index eeaf1a3929..2c6d0071c2 100644 --- a/docs/framework/angular/reference/type-aliases/InjectConditionalLiveQueryResult.md +++ b/docs/framework/angular/reference/type-aliases/InjectConditionalLiveQueryResult.md @@ -7,7 +7,7 @@ title: InjectConditionalLiveQueryResult type InjectConditionalLiveQueryResult = Omit, "data"> & object; ``` -Defined in: [angular-db/src/index.ts:85](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L85) +Defined in: [angular-db/src/index.ts:73](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L73) ## Type Declaration diff --git a/docs/framework/angular/reference/type-aliases/InjectLiveQueryFlags.md b/docs/framework/angular/reference/type-aliases/InjectLiveQueryFlags.md new file mode 100644 index 0000000000..6062e7461a --- /dev/null +++ b/docs/framework/angular/reference/type-aliases/InjectLiveQueryFlags.md @@ -0,0 +1,22 @@ +--- +id: InjectLiveQueryFlags +title: InjectLiveQueryFlags +--- + +```ts +type InjectLiveQueryFlags = object & { [K in keyof LiveQueryStatusFlags]: Signal }; +``` + +Defined in: [angular-db/src/index.ts:46](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L46) + +The status and flag signals every `injectLiveQuery` result has. + +## Type Declaration + +### status + +```ts +status: Signal; +``` + +A signal containing the current status of the collection diff --git a/docs/framework/preact/reference/functions/useLiveQuery.md b/docs/framework/preact/reference/functions/useLiveQuery.md index 4040c8b2fe..dfa7ffec95 100644 --- a/docs/framework/preact/reference/functions/useLiveQuery.md +++ b/docs/framework/preact/reference/functions/useLiveQuery.md @@ -9,7 +9,7 @@ title: useLiveQuery function useLiveQuery(queryFn): QueryResult; ``` -Defined in: [useLiveQuery.ts:154](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L154) +Defined in: [useLiveQuery.ts:142](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L142) Subscribe a Preact component to a live query. @@ -64,7 +64,7 @@ const { data, isEnabled } = useLiveQuery((q) => function useLiveQuery(queryFn): ConditionalQueryResult; ``` -Defined in: [useLiveQuery.ts:158](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L158) +Defined in: [useLiveQuery.ts:146](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L146) Subscribe a Preact component to a live query. @@ -119,7 +119,7 @@ const { data, isEnabled } = useLiveQuery((q) => function useLiveQuery(queryFn): ConditionalQueryResult; ``` -Defined in: [useLiveQuery.ts:164](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L164) +Defined in: [useLiveQuery.ts:152](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L152) Subscribe a Preact component to a live query. @@ -177,7 +177,7 @@ const { data, isEnabled } = useLiveQuery((q) => function useLiveQuery(queryFn): UseConditionalLiveQueryResult, TResult>>; ``` -Defined in: [useLiveQuery.ts:170](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L170) +Defined in: [useLiveQuery.ts:158](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L158) Subscribe a Preact component to a live query. @@ -243,7 +243,7 @@ const { data, isEnabled } = useLiveQuery((q) => function useLiveQuery(config): QueryResult; ``` -Defined in: [useLiveQuery.ts:194](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L194) +Defined in: [useLiveQuery.ts:182](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L182) Subscribe to a live query described by a config object. @@ -278,7 +278,7 @@ const { data } = useLiveQuery({ function useLiveQuery(config): ConditionalQueryResult; ``` -Defined in: [useLiveQuery.ts:198](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L198) +Defined in: [useLiveQuery.ts:186](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L186) Subscribe a Preact component to a live query. @@ -333,7 +333,7 @@ const { data, isEnabled } = useLiveQuery((q) => function useLiveQuery(liveQueryCollection): UseLiveQueryResult, TResult>>; ``` -Defined in: [useLiveQuery.ts:212](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L212) +Defined in: [useLiveQuery.ts:200](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L200) Subscribe to an existing live-query Collection. The hook starts its sync and leaves its retention policy to the caller. @@ -377,7 +377,7 @@ const { data, collection } = useLiveQuery(activeTodos) function useLiveQuery(liveQueryCollection): UseLiveQueryResult, TResult> & SingleResult>; ``` -Defined in: [useLiveQuery.ts:225](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L225) +Defined in: [useLiveQuery.ts:213](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L213) Subscribe a Preact component to a live query. diff --git a/docs/framework/preact/reference/interfaces/UseConditionalLiveQueryResult.md b/docs/framework/preact/reference/interfaces/UseConditionalLiveQueryResult.md index 4dd659d970..7bb120cdde 100644 --- a/docs/framework/preact/reference/interfaces/UseConditionalLiveQueryResult.md +++ b/docs/framework/preact/reference/interfaces/UseConditionalLiveQueryResult.md @@ -3,13 +3,13 @@ id: UseConditionalLiveQueryResult title: UseConditionalLiveQueryResult --- -Defined in: [useLiveQuery.ts:98](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L98) +Defined in: [useLiveQuery.ts:86](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L86) The result of a live query whose callback can disable it. ## Extends -- `LiveQueryResultFlags` +- `LiveQueryStatusFlags` ## Type Parameters @@ -37,7 +37,7 @@ The result of a live query whose callback can disable it. collection: TCollection | undefined; ``` -Defined in: [useLiveQuery.ts:106](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L106) +Defined in: [useLiveQuery.ts:94](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L94) *** @@ -47,26 +47,7 @@ Defined in: [useLiveQuery.ts:106](https://github.com/TanStack/db/blob/main/packa data: TData | undefined; ``` -Defined in: [useLiveQuery.ts:105](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L105) - -*** - -### health - -```ts -health: HealthNode | undefined; -``` - -Defined in: [useLiveQuery.ts:80](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L80) - -The health tree for the query and every Collection it depends on, or -`undefined` for a disabled query. - -#### Inherited from - -```ts -LiveQueryResultFlags.health -``` +Defined in: [useLiveQuery.ts:93](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L93) *** @@ -76,25 +57,7 @@ LiveQueryResultFlags.health isEnabled: boolean; ``` -Defined in: [useLiveQuery.ts:108](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L108) - -*** - -### isSyncError - -```ts -isSyncError: boolean; -``` - -Defined in: [useLiveQuery.ts:75](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L75) - -The data is shown, and a sync problem or failed request is in `health`. - -#### Inherited from - -```ts -LiveQueryResultFlags.isSyncError -``` +Defined in: [useLiveQuery.ts:96](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L96) *** @@ -104,7 +67,7 @@ LiveQueryResultFlags.isSyncError state: ReadonlyMap | undefined; ``` -Defined in: [useLiveQuery.ts:104](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L104) +Defined in: [useLiveQuery.ts:92](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L92) *** @@ -114,4 +77,4 @@ Defined in: [useLiveQuery.ts:104](https://github.com/TanStack/db/blob/main/packa status: UseLiveQueryStatus; ``` -Defined in: [useLiveQuery.ts:107](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L107) +Defined in: [useLiveQuery.ts:95](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L95) diff --git a/docs/framework/preact/reference/interfaces/UseLiveQueryResult.md b/docs/framework/preact/reference/interfaces/UseLiveQueryResult.md index b46858c7b1..149f297e50 100644 --- a/docs/framework/preact/reference/interfaces/UseLiveQueryResult.md +++ b/docs/framework/preact/reference/interfaces/UseLiveQueryResult.md @@ -3,13 +3,13 @@ id: UseLiveQueryResult title: UseLiveQueryResult --- -Defined in: [useLiveQuery.ts:84](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L84) +Defined in: [useLiveQuery.ts:72](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L72) The result of a live query that is always enabled. ## Extends -- `LiveQueryResultFlags` +- `LiveQueryStatusFlags` ## Type Parameters @@ -37,7 +37,7 @@ The result of a live query that is always enabled. collection: TCollection; ``` -Defined in: [useLiveQuery.ts:92](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L92) +Defined in: [useLiveQuery.ts:80](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L80) *** @@ -47,26 +47,7 @@ Defined in: [useLiveQuery.ts:92](https://github.com/TanStack/db/blob/main/packag data: TData; ``` -Defined in: [useLiveQuery.ts:91](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L91) - -*** - -### health - -```ts -health: HealthNode | undefined; -``` - -Defined in: [useLiveQuery.ts:80](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L80) - -The health tree for the query and every Collection it depends on, or -`undefined` for a disabled query. - -#### Inherited from - -```ts -LiveQueryResultFlags.health -``` +Defined in: [useLiveQuery.ts:79](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L79) *** @@ -76,25 +57,7 @@ LiveQueryResultFlags.health isEnabled: true; ``` -Defined in: [useLiveQuery.ts:94](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L94) - -*** - -### isSyncError - -```ts -isSyncError: boolean; -``` - -Defined in: [useLiveQuery.ts:75](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L75) - -The data is shown, and a sync problem or failed request is in `health`. - -#### Inherited from - -```ts -LiveQueryResultFlags.isSyncError -``` +Defined in: [useLiveQuery.ts:82](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L82) *** @@ -104,7 +67,7 @@ LiveQueryResultFlags.isSyncError state: ReadonlyMap; ``` -Defined in: [useLiveQuery.ts:90](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L90) +Defined in: [useLiveQuery.ts:78](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L78) *** @@ -114,4 +77,4 @@ Defined in: [useLiveQuery.ts:90](https://github.com/TanStack/db/blob/main/packag status: CollectionStatus; ``` -Defined in: [useLiveQuery.ts:93](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L93) +Defined in: [useLiveQuery.ts:81](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L81) diff --git a/docs/framework/preact/reference/type-aliases/ConditionalUseLiveQueryConfig.md b/docs/framework/preact/reference/type-aliases/ConditionalUseLiveQueryConfig.md index 3385f9eb3b..34e9645937 100644 --- a/docs/framework/preact/reference/type-aliases/ConditionalUseLiveQueryConfig.md +++ b/docs/framework/preact/reference/type-aliases/ConditionalUseLiveQueryConfig.md @@ -7,7 +7,7 @@ title: ConditionalUseLiveQueryConfig type ConditionalUseLiveQueryConfig = UseLiveQueryConfigOptions & object; ``` -Defined in: [useLiveQuery.ts:63](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L63) +Defined in: [useLiveQuery.ts:62](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L62) ## Type Declaration diff --git a/docs/framework/preact/reference/type-aliases/UseLiveQueryConfig.md b/docs/framework/preact/reference/type-aliases/UseLiveQueryConfig.md index 3834faa19f..d37cf43186 100644 --- a/docs/framework/preact/reference/type-aliases/UseLiveQueryConfig.md +++ b/docs/framework/preact/reference/type-aliases/UseLiveQueryConfig.md @@ -7,7 +7,7 @@ title: UseLiveQueryConfig type UseLiveQueryConfig = UseLiveQueryConfigOptions & Pick, "query">; ``` -Defined in: [useLiveQuery.ts:59](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L59) +Defined in: [useLiveQuery.ts:58](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L58) ## Type Parameters diff --git a/docs/framework/preact/reference/type-aliases/UseLiveQueryStatus.md b/docs/framework/preact/reference/type-aliases/UseLiveQueryStatus.md index e86fd36b2c..b62eb6f9f0 100644 --- a/docs/framework/preact/reference/type-aliases/UseLiveQueryStatus.md +++ b/docs/framework/preact/reference/type-aliases/UseLiveQueryStatus.md @@ -7,4 +7,4 @@ title: UseLiveQueryStatus type UseLiveQueryStatus = CollectionStatus | "disabled"; ``` -Defined in: [useLiveQuery.ts:36](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L36) +Defined in: [useLiveQuery.ts:35](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L35) diff --git a/docs/framework/react/reference/functions/useLiveInfiniteQuery.md b/docs/framework/react/reference/functions/useLiveInfiniteQuery.md index ece52a7171..07b80fd164 100644 --- a/docs/framework/react/reference/functions/useLiveInfiniteQuery.md +++ b/docs/framework/react/reference/functions/useLiveInfiniteQuery.md @@ -9,7 +9,7 @@ title: useLiveInfiniteQuery function useLiveInfiniteQuery(liveQueryCollection, config): UseLiveInfiniteQueryReturnWithCollection; ``` -Defined in: [useLiveInfiniteQuery.ts:130](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L130) +Defined in: [useLiveInfiniteQuery.ts:116](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L116) Create an infinite query using a query function with live updates. @@ -51,13 +51,10 @@ Object with pages, data, and pagination controls ## Call Signature ```ts -function useLiveInfiniteQuery( - queryFn, - config, -deps?): UseLiveInfiniteQueryReturn; +function useLiveInfiniteQuery(queryFn, config): UseLiveInfiniteQueryReturn; ``` -Defined in: [useLiveInfiniteQuery.ts:140](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L140) +Defined in: [useLiveInfiniteQuery.ts:126](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L126) Create an infinite query using a query function with live updates. @@ -84,12 +81,6 @@ Query function that defines what data to fetch. Must include `.orderBy()` for se Configuration including pageSize and an optional initial page label -#### deps? - -`unknown`[] - -Deprecated array of dependencies that trigger query re-execution when changed - ### Returns [`UseLiveInfiniteQueryReturn`](../type-aliases/UseLiveInfiniteQueryReturn.md)\<`TContext`\> diff --git a/docs/framework/react/reference/functions/useLiveQuery.md b/docs/framework/react/reference/functions/useLiveQuery.md index 1c8a17cdc2..2d52ea0c02 100644 --- a/docs/framework/react/reference/functions/useLiveQuery.md +++ b/docs/framework/react/reference/functions/useLiveQuery.md @@ -6,10 +6,10 @@ title: useLiveQuery ## Call Signature ```ts -function useLiveQuery(queryFn, deps?): object & LiveQueryStatusFlags & object; +function useLiveQuery(queryFn): object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:394](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L394) +Defined in: [useLiveQuery.ts:359](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L359) Create a live query using a query function. @@ -27,14 +27,10 @@ Create a live query using a query function. Query function that defines what data to fetch -#### deps? - -`unknown`[] - -Deprecated array of dependencies that trigger query re-execution when changed - ### Returns +`object` & `LiveQueryStatusFlags` + Object with reactive data, state, and status information ### Examples @@ -112,10 +108,10 @@ return ( ## Call Signature ```ts -function useLiveQuery(queryFn, deps?): object & LiveQueryStatusFlags & object; +function useLiveQuery(queryFn): object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:406](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L406) +Defined in: [useLiveQuery.ts:370](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L370) Create a live query using a query function. @@ -133,14 +129,10 @@ Create a live query using a query function. Query function that defines what data to fetch -#### deps? - -`unknown`[] - -Deprecated array of dependencies that trigger query re-execution when changed - ### Returns +`object` & `LiveQueryStatusFlags` + Object with reactive data, state, and status information ### Examples @@ -218,10 +210,10 @@ return ( ## Call Signature ```ts -function useLiveQuery(queryFn, deps?): object & LiveQueryStatusFlags & object; +function useLiveQuery(queryFn): object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:420](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L420) +Defined in: [useLiveQuery.ts:383](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L383) Create a live query using a query function. @@ -242,14 +234,10 @@ Create a live query using a query function. Query function that defines what data to fetch -#### deps? - -`unknown`[] - -Deprecated array of dependencies that trigger query re-execution when changed - ### Returns +`object` & `LiveQueryStatusFlags` + Object with reactive data, state, and status information ### Examples @@ -327,10 +315,10 @@ return ( ## Call Signature ```ts -function useLiveQuery(queryFn, deps?): object & LiveQueryStatusFlags & object; +function useLiveQuery(queryFn): object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:434](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L434) +Defined in: [useLiveQuery.ts:396](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L396) Create a live query using a query function. @@ -359,14 +347,10 @@ Create a live query using a query function. Query function that defines what data to fetch -#### deps? - -`unknown`[] - -Deprecated array of dependencies that trigger query re-execution when changed - ### Returns +`object` & `LiveQueryStatusFlags` + Object with reactive data, state, and status information ### Examples @@ -444,10 +428,10 @@ return ( ## Call Signature ```ts -function useLiveQuery(queryFn, deps?): object & LiveQueryStatusFlags & object; +function useLiveQuery(queryFn): object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:452](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L452) +Defined in: [useLiveQuery.ts:413](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L413) Create a live query using a query function. @@ -482,14 +466,10 @@ Create a live query using a query function. Query function that defines what data to fetch -#### deps? - -`unknown`[] - -Deprecated array of dependencies that trigger query re-execution when changed - ### Returns +`object` & `LiveQueryStatusFlags` + Object with reactive data, state, and status information ### Examples @@ -567,10 +547,10 @@ return ( ## Call Signature ```ts -function useLiveQuery(config): object & LiveQueryStatusFlags & object; +function useLiveQuery(config): object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:515](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L515) +Defined in: [useLiveQuery.ts:474](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L474) Create a live query using configuration object @@ -590,6 +570,8 @@ Configuration object with query and options ### Returns +`object` & `LiveQueryStatusFlags` + Object with reactive data, state, and status information ### Examples @@ -630,10 +612,10 @@ return
{data.length} items loaded
## Call Signature ```ts -function useLiveQuery(config): object & LiveQueryStatusFlags & object; +function useLiveQuery(config): object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:526](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L526) +Defined in: [useLiveQuery.ts:485](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L485) Create a live query using a query function. @@ -651,109 +633,7 @@ Create a live query using a query function. ### Returns -Object with reactive data, state, and status information - -### Examples - -```ts -// Prefer config object syntax -const { data, isLoading } = useLiveQuery({ - query: (q) => - q.from({ todos: todosCollection }) - .where(({ todos }) => eq(todos.completed, false)) - .select(({ todos }) => ({ id: todos.id, text: todos.text })) -}) -``` - -```ts -// Single result query -const { data } = useLiveQuery({ - query: (q) => q.from({ todos: todosCollection }) - .where(({ todos }) => eq(todos.id, 1)) - .findOne() -}) -``` - -```ts -// Structured captured values are included in derived query identity -const { data, state } = useLiveQuery({ - query: (q) => q.from({ todos: todosCollection }) - .where(({ todos }) => gt(todos.priority, minPriority)), -}) -``` - -```ts -// Return undefined or null to disable a query -const { data, isEnabled } = useLiveQuery({ - query: (q) => { - if (!userId) return undefined - return q.from({ todos: todosCollection }) - .where(({ todos }) => eq(todos.userId, userId)) - }, -}) -``` - -```ts -// Join pattern -const { data } = useLiveQuery({ - query: (q) => - q.from({ issues: issueCollection }) - .join({ persons: personCollection }, ({ issues, persons }) => - eq(issues.userId, persons.id) - ) - .select(({ issues, persons }) => ({ - id: issues.id, - title: issues.title, - userName: persons.name - })) -}) -``` - -```ts -// Handle loading and error states -const { data, isLoading, isLoadingError, status } = useLiveQuery({ - query: (q) => q.from({ todos: todoCollection }) -}) - -if (isLoading) return
Loading...
-if (isLoadingError) return
Error: {status}
- -return ( -
    - {data.map(todo =>
  • {todo.text}
  • )} -
-) -``` - -## Call Signature - -```ts -function useLiveQuery(config, deps?): object & LiveQueryStatusFlags & object; -``` - -Defined in: [useLiveQuery.ts:537](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L537) - -Create a live query using a query function. - -### Type Parameters - -#### TContext - -`TContext` *extends* `Context` - -### Parameters - -#### config - -`LiveQueryCollectionConfig`\<`TContext`\> - -#### deps? - -`unknown`[] - -Deprecated array of dependencies that trigger query re-execution when changed - -### Returns +`object` & `LiveQueryStatusFlags` Object with reactive data, state, and status information @@ -832,114 +712,10 @@ return ( ## Call Signature ```ts -function useLiveQuery(config, deps): object & LiveQueryStatusFlags & object; +function useLiveQuery(liveQueryCollection): object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:549](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L549) - -Create a live query using a query function. - -### Type Parameters - -#### TContext - -`TContext` *extends* `Context` - -### Parameters - -#### config - -[`ConditionalUseLiveQueryConfig`](../type-aliases/ConditionalUseLiveQueryConfig.md)\<`TContext`\> - -#### deps - -`unknown`[] - -Deprecated array of dependencies that trigger query re-execution when changed - -### Returns - -Object with reactive data, state, and status information - -### Examples - -```ts -// Prefer config object syntax -const { data, isLoading } = useLiveQuery({ - query: (q) => - q.from({ todos: todosCollection }) - .where(({ todos }) => eq(todos.completed, false)) - .select(({ todos }) => ({ id: todos.id, text: todos.text })) -}) -``` - -```ts -// Single result query -const { data } = useLiveQuery({ - query: (q) => q.from({ todos: todosCollection }) - .where(({ todos }) => eq(todos.id, 1)) - .findOne() -}) -``` - -```ts -// Structured captured values are included in derived query identity -const { data, state } = useLiveQuery({ - query: (q) => q.from({ todos: todosCollection }) - .where(({ todos }) => gt(todos.priority, minPriority)), -}) -``` - -```ts -// Return undefined or null to disable a query -const { data, isEnabled } = useLiveQuery({ - query: (q) => { - if (!userId) return undefined - return q.from({ todos: todosCollection }) - .where(({ todos }) => eq(todos.userId, userId)) - }, -}) -``` - -```ts -// Join pattern -const { data } = useLiveQuery({ - query: (q) => - q.from({ issues: issueCollection }) - .join({ persons: personCollection }, ({ issues, persons }) => - eq(issues.userId, persons.id) - ) - .select(({ issues, persons }) => ({ - id: issues.id, - title: issues.title, - userName: persons.name - })) -}) -``` - -```ts -// Handle loading and error states -const { data, isLoading, isLoadingError, status } = useLiveQuery({ - query: (q) => q.from({ todos: todoCollection }) -}) - -if (isLoading) return
Loading...
-if (isLoadingError) return
Error: {status}
- -return ( -
    - {data.map(todo =>
  • {todo.text}
  • )} -
-) -``` - -## Call Signature - -```ts -function useLiveQuery(liveQueryCollection): object & LiveQueryStatusFlags & object; -``` - -Defined in: [useLiveQuery.ts:590](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L590) +Defined in: [useLiveQuery.ts:525](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L525) Subscribe to an existing live query collection @@ -967,6 +743,8 @@ Pre-created live query collection to subscribe to ### Returns +`object` & `LiveQueryStatusFlags` + Object with reactive data, state, and status information ### Examples @@ -1002,10 +780,10 @@ return
{data.map(item => )}
## Call Signature ```ts -function useLiveQuery(liveQueryCollection): object & LiveQueryStatusFlags & object; +function useLiveQuery(liveQueryCollection): object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:605](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L605) +Defined in: [useLiveQuery.ts:540](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L540) Create a live query using a query function. @@ -1031,6 +809,8 @@ Create a live query using a query function. ### Returns +`object` & `LiveQueryStatusFlags` + Object with reactive data, state, and status information ### Examples diff --git a/docs/framework/react/reference/functions/useLiveSuspenseQuery.md b/docs/framework/react/reference/functions/useLiveSuspenseQuery.md index 942e84694d..bac36f5d2f 100644 --- a/docs/framework/react/reference/functions/useLiveSuspenseQuery.md +++ b/docs/framework/react/reference/functions/useLiveSuspenseQuery.md @@ -6,10 +6,10 @@ title: useLiveSuspenseQuery ## Call Signature ```ts -function useLiveSuspenseQuery(queryFn, deps?): object; +function useLiveSuspenseQuery(queryFn): object; ``` -Defined in: [useLiveSuspenseQuery.ts:156](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveSuspenseQuery.ts#L156) +Defined in: [useLiveSuspenseQuery.ts:154](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveSuspenseQuery.ts#L154) Create a live query with React Suspense support @@ -27,12 +27,6 @@ Create a live query with React Suspense support Query function that defines what data to fetch -#### deps? - -`unknown`[] - -Deprecated array of dependencies that trigger query re-execution when changed - ### Returns `object` @@ -171,7 +165,7 @@ function Profile({ userId }: { userId: string }) { function useLiveSuspenseQuery(config): object; ``` -Defined in: [useLiveSuspenseQuery.ts:167](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveSuspenseQuery.ts#L167) +Defined in: [useLiveSuspenseQuery.ts:164](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveSuspenseQuery.ts#L164) Create a live query with React Suspense support @@ -321,171 +315,11 @@ function Profile({ userId }: { userId: string }) { ## Call Signature -```ts -function useLiveSuspenseQuery(config, deps?): object; -``` - -Defined in: [useLiveSuspenseQuery.ts:177](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveSuspenseQuery.ts#L177) - -Create a live query with React Suspense support - -### Type Parameters - -#### TContext - -`TContext` *extends* `Context` - -### Parameters - -#### config - -`LiveQueryCollectionConfig`\<`TContext`\> - -#### deps? - -`unknown`[] - -Deprecated array of dependencies that trigger query re-execution when changed - -### Returns - -`object` - -Object with reactive data and state - data is guaranteed to be defined - -#### collection - -```ts -collection: Collection<{ [K in string | number | symbol]: ResultValue[K] }, string | number, { -}>; -``` - -#### data - -```ts -data: InferResultType; -``` - -#### health - -```ts -health: HealthNode | undefined; -``` - -#### state - -```ts -state: Map[K] }>; -``` - -### Throws - -Promise when data is loading (caught by Suspense boundary) - -### Throws - -Error when the first load fails or the Collection crashes (caught by -an Error boundary): the cause itself when it is an Error, otherwise an Error -with the problem's message (`health.error.message`) whose `cause` is the -value the sync adapter reported - -### Examples - -```ts -// Basic usage with Suspense -function TodoList() { - const { data } = useLiveSuspenseQuery({ - query: (q) => - q.from({ todos: todosCollection }) - .where(({ todos }) => eq(todos.completed, false)) - .select(({ todos }) => ({ id: todos.id, text: todos.text })) - }) - - return ( -
    - {data.map(todo =>
  • {todo.text}
  • )} -
- ) -} - -function App() { - return ( - Loading...}> - - - ) -} -``` - -```ts -// Single result query -const { data } = useLiveSuspenseQuery( - (q) => q.from({ todos: todosCollection }) - .where(({ todos }) => eq(todos.id, 1)) - .findOne() -) -// data is guaranteed to be the single item (or undefined if not found) -``` - -```ts -// Structured captured values are included in derived query identity and trigger re-suspension -const { data } = useLiveSuspenseQuery({ - query: (q) => q.from({ todos: todosCollection }) - .where(({ todos }) => gt(todos.priority, minPriority)), -}) -``` - -```ts -// With Error boundary -function App() { - return ( - Error loading data}> - Loading...}> - - - - ) -} -``` - -### Remarks - -**Important:** This hook does NOT support disabled queries (returning undefined/null). -Following TanStack Query's useSuspenseQuery design, the query callback must always -return a valid query, collection, or config object. - -❌ **This will cause a type error:** -```ts -useLiveSuspenseQuery( - (q) => userId ? q.from({ users }) : undefined // ❌ Error! -) -``` - -✅ **Use conditional rendering instead:** -```ts -function Profile({ userId }: { userId: string }) { - const { data } = useLiveSuspenseQuery({ - query: (q) => q.from({ users }).where(({ users }) => eq(users.id, userId)), - }) - return
{data.name}
-} - -// In parent component: -{userId ? :
No user
} -``` - -✅ **For optional inputs, conditionally render a component with complete query inputs:** -```ts -{userId ? :
No user
} -``` - -## Call Signature - ```ts function useLiveSuspenseQuery(liveQueryCollection): object; ``` -Defined in: [useLiveSuspenseQuery.ts:188](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveSuspenseQuery.ts#L188) +Defined in: [useLiveSuspenseQuery.ts:174](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveSuspenseQuery.ts#L174) Create a live query with React Suspense support @@ -646,7 +480,7 @@ function Profile({ userId }: { userId: string }) { function useLiveSuspenseQuery(liveQueryCollection): object; ``` -Defined in: [useLiveSuspenseQuery.ts:202](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveSuspenseQuery.ts#L202) +Defined in: [useLiveSuspenseQuery.ts:188](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveSuspenseQuery.ts#L188) Create a live query with React Suspense support diff --git a/docs/framework/react/reference/functions/usePacedMutations.md b/docs/framework/react/reference/functions/usePacedMutations.md index fc004e3549..0987e6009c 100644 --- a/docs/framework/react/reference/functions/usePacedMutations.md +++ b/docs/framework/react/reference/functions/usePacedMutations.md @@ -76,7 +76,7 @@ function AutoSaveForm({ formId }: { formId: string }) { // Optional: await persistence or handle errors try { - await tx.isPersisted.promise + await tx.when('settled') console.log('Saved!') } catch (error) { console.error('Save failed:', error) diff --git a/docs/framework/react/reference/type-aliases/ConditionalUseLiveQueryConfig.md b/docs/framework/react/reference/type-aliases/ConditionalUseLiveQueryConfig.md index 79933c0089..f928182c17 100644 --- a/docs/framework/react/reference/type-aliases/ConditionalUseLiveQueryConfig.md +++ b/docs/framework/react/reference/type-aliases/ConditionalUseLiveQueryConfig.md @@ -7,7 +7,7 @@ title: ConditionalUseLiveQueryConfig type ConditionalUseLiveQueryConfig = UseLiveQueryConfigOptions & object; ``` -Defined in: [useLiveQuery.ts:146](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L146) +Defined in: [useLiveQuery.ts:143](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L143) ## Type Declaration diff --git a/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryConfig.md b/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryConfig.md index b0cd7defcb..806f21ebde 100644 --- a/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryConfig.md +++ b/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryConfig.md @@ -7,7 +7,7 @@ title: UseLiveInfiniteQueryConfig type UseLiveInfiniteQueryConfig<_TContext> = object; ``` -Defined in: [useLiveInfiniteQuery.ts:46](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L46) +Defined in: [useLiveInfiniteQuery.ts:44](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L44) ## Type Parameters @@ -23,7 +23,7 @@ Defined in: [useLiveInfiniteQuery.ts:46](https://github.com/TanStack/db/blob/mai optional client: DbClient; ``` -Defined in: [useLiveInfiniteQuery.ts:54](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L54) +Defined in: [useLiveInfiniteQuery.ts:52](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L52) Override the nearest DbProvider for this query. @@ -35,7 +35,7 @@ Override the nearest DbProvider for this query. optional initialPageParam: number; ``` -Defined in: [useLiveInfiniteQuery.ts:57](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L57) +Defined in: [useLiveInfiniteQuery.ts:55](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L55) First result-page label, not a server cursor or remote offset. @@ -47,7 +47,7 @@ First result-page label, not a server cursor or remote offset. optional pageSize: number; ``` -Defined in: [useLiveInfiniteQuery.ts:55](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L55) +Defined in: [useLiveInfiniteQuery.ts:53](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L53) *** @@ -57,7 +57,7 @@ Defined in: [useLiveInfiniteQuery.ts:55](https://github.com/TanStack/db/blob/mai optional queryKey: LiveQueryKey; ``` -Defined in: [useLiveInfiniteQuery.ts:52](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L52) +Defined in: [useLiveInfiniteQuery.ts:50](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L50) Explicit identity for queries that contain opaque functional variants or are hot enough that deriving identity from structured IR is too expensive. diff --git a/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryReturn.md b/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryReturn.md index dc99455d27..50fa2f7632 100644 --- a/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryReturn.md +++ b/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryReturn.md @@ -7,7 +7,7 @@ title: UseLiveInfiniteQueryReturn type UseLiveInfiniteQueryReturn = Omit, "data"> & object; ``` -Defined in: [useLiveInfiniteQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L60) +Defined in: [useLiveInfiniteQuery.ts:58](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L58) ## Type Declaration diff --git a/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryReturnWithCollection.md b/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryReturnWithCollection.md index 97d15813c7..dae229eb2f 100644 --- a/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryReturnWithCollection.md +++ b/docs/framework/react/reference/type-aliases/UseLiveInfiniteQueryReturnWithCollection.md @@ -4,26 +4,12 @@ title: UseLiveInfiniteQueryReturnWithCollection --- ```ts -type UseLiveInfiniteQueryReturnWithCollection = object; +type UseLiveInfiniteQueryReturnWithCollection = LiveQueryStatusFlags & object; ``` -Defined in: [useLiveInfiniteQuery.ts:72](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L72) +Defined in: [useLiveInfiniteQuery.ts:70](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L70) -## Type Parameters - -### TResult - -`TResult` *extends* `object` - -### TKey - -`TKey` *extends* `string` \| `number` - -### TUtils - -`TUtils` *extends* `Record`\<`string`, `any`\> - -## Properties +## Type Declaration ### collection @@ -31,184 +17,74 @@ Defined in: [useLiveInfiniteQuery.ts:72](https://github.com/TanStack/db/blob/mai collection: Collection & NonSingleResult; ``` -Defined in: [useLiveInfiniteQuery.ts:79](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L79) - -*** - ### data ```ts data: TResult[]; ``` -Defined in: [useLiveInfiniteQuery.ts:77](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L77) - -*** - ### fetchNextPage() ```ts fetchNextPage: () => Promise; ``` -Defined in: [useLiveInfiniteQuery.ts:94](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L94) - #### Returns `Promise`\<`void`\> -*** - ### hasNextPage ```ts hasNextPage: boolean; ``` -Defined in: [useLiveInfiniteQuery.ts:95](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L95) - -*** - -### health - -```ts -health: HealthNode | undefined; -``` - -Defined in: [useLiveInfiniteQuery.ts:97](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L97) - -*** - -### isCleanedUp - -```ts -isCleanedUp: boolean; -``` - -Defined in: [useLiveInfiniteQuery.ts:88](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L88) - -*** - -### isCrashed - -```ts -isCrashed: boolean; -``` - -Defined in: [useLiveInfiniteQuery.ts:87](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L87) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. - -*** - ### isEnabled ```ts isEnabled: true; ``` -Defined in: [useLiveInfiniteQuery.ts:91](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L91) - -*** - ### isFetchingNextPage ```ts isFetchingNextPage: boolean; ``` -Defined in: [useLiveInfiniteQuery.ts:96](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L96) - -*** - -### isIdle - -```ts -isIdle: boolean; -``` - -Defined in: [useLiveInfiniteQuery.ts:83](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L83) - -*** - -### isLoading - -```ts -isLoading: boolean; -``` - -Defined in: [useLiveInfiniteQuery.ts:81](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L81) - -*** - -### isLoadingError - -```ts -isLoadingError: boolean; -``` - -Defined in: [useLiveInfiniteQuery.ts:85](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L85) - -The first load failed: there is nothing to show. - -*** - -### isReady - -```ts -isReady: boolean; -``` - -Defined in: [useLiveInfiniteQuery.ts:82](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L82) - -*** - -### isSyncError - -```ts -isSyncError: boolean; -``` - -Defined in: [useLiveInfiniteQuery.ts:90](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L90) - -The data is shown, and a sync problem or failed page load is in `health`. - -*** - ### pageParams ```ts pageParams: number[]; ``` -Defined in: [useLiveInfiniteQuery.ts:93](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L93) - -*** - ### pages ```ts pages: TResult[][]; ``` -Defined in: [useLiveInfiniteQuery.ts:92](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L92) - -*** - ### state ```ts state: Map; ``` -Defined in: [useLiveInfiniteQuery.ts:78](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L78) - -*** - ### status ```ts status: CollectionStatus; ``` -Defined in: [useLiveInfiniteQuery.ts:80](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveInfiniteQuery.ts#L80) +## Type Parameters + +### TResult + +`TResult` *extends* `object` + +### TKey + +`TKey` *extends* `string` \| `number` + +### TUtils + +`TUtils` *extends* `Record`\<`string`, `any`\> diff --git a/docs/framework/react/reference/type-aliases/UseLiveQueryConfig.md b/docs/framework/react/reference/type-aliases/UseLiveQueryConfig.md index 7eb2cf12c7..3037a719f2 100644 --- a/docs/framework/react/reference/type-aliases/UseLiveQueryConfig.md +++ b/docs/framework/react/reference/type-aliases/UseLiveQueryConfig.md @@ -7,7 +7,7 @@ title: UseLiveQueryConfig type UseLiveQueryConfig = UseLiveQueryConfigOptions & Pick, "query">; ``` -Defined in: [useLiveQuery.ts:142](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L142) +Defined in: [useLiveQuery.ts:139](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L139) ## Type Parameters diff --git a/docs/framework/react/reference/type-aliases/UseLiveQueryStatus.md b/docs/framework/react/reference/type-aliases/UseLiveQueryStatus.md index 56d9e814b7..878105acea 100644 --- a/docs/framework/react/reference/type-aliases/UseLiveQueryStatus.md +++ b/docs/framework/react/reference/type-aliases/UseLiveQueryStatus.md @@ -7,4 +7,4 @@ title: UseLiveQueryStatus type UseLiveQueryStatus = CollectionStatus | "disabled"; ``` -Defined in: [useLiveQuery.ts:116](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L116) +Defined in: [useLiveQuery.ts:113](https://github.com/TanStack/db/blob/main/packages/react-db/src/useLiveQuery.ts#L113) diff --git a/docs/framework/solid/reference/functions/useLiveQuery.md b/docs/framework/solid/reference/functions/useLiveQuery.md index 85eaf48ad3..c0b0880c9b 100644 --- a/docs/framework/solid/reference/functions/useLiveQuery.md +++ b/docs/framework/solid/reference/functions/useLiveQuery.md @@ -6,10 +6,10 @@ title: useLiveQuery ## Call Signature ```ts -function useLiveQuery(queryFn): Accessor> & object & LiveQueryStatusFlags & object; +function useLiveQuery(queryFn): Accessor> & object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:123](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L123) +Defined in: [useLiveQuery.ts:117](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L117) Create a live query using a query function @@ -29,6 +29,8 @@ Query function that defines what data to fetch ### Returns +`Accessor`\<`InferResultType`\<`TContext`\>\> & `object` & `LiveQueryStatusFlags` + Accessor that returns data with Suspense support, with state and status information as properties ### Examples @@ -106,10 +108,10 @@ return ( ## Call Signature ```ts -function useLiveQuery(queryFn): Accessor> & object & LiveQueryStatusFlags & object; +function useLiveQuery(queryFn): Accessor> & object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:137](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L137) +Defined in: [useLiveQuery.ts:126](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L126) Create a live query using a query function @@ -129,6 +131,8 @@ Query function that defines what data to fetch ### Returns +`Accessor`\<`InferConditionalResultType`\<`TContext`\>\> & `object` & `LiveQueryStatusFlags` + Accessor that returns data with Suspense support, with state and status information as properties ### Examples @@ -206,10 +210,10 @@ return ( ## Call Signature ```ts -function useLiveQuery(config): Accessor> & object & LiveQueryStatusFlags & object; +function useLiveQuery(config): Accessor> & object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:193](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L193) +Defined in: [useLiveQuery.ts:177](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L177) Create a live query using configuration object @@ -229,6 +233,8 @@ Configuration object with query and options ### Returns +`Accessor`\<`InferResultType`\<`TContext`\>\> & `object` & `LiveQueryStatusFlags` + Accessor that returns data with Suspense support, with state and status information as properties ### Examples @@ -275,10 +281,10 @@ return ( ## Call Signature ```ts -function useLiveQuery(liveQueryCollection): Accessor & object & LiveQueryStatusFlags & object; +function useLiveQuery(liveQueryCollection): Accessor & object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:242](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L242) +Defined in: [useLiveQuery.ts:221](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L221) Subscribe to an existing live query collection @@ -306,6 +312,8 @@ Pre-created live query collection to subscribe to ### Returns +`Accessor`\<`TResult`[]\> & `object` & `LiveQueryStatusFlags` + Accessor that returns data with Suspense support, with state and status information as properties ### Examples @@ -347,10 +355,10 @@ return ( ## Call Signature ```ts -function useLiveQuery(liveQueryCollection): Accessor & object & LiveQueryStatusFlags & object; +function useLiveQuery(liveQueryCollection): Accessor & object & LiveQueryStatusFlags; ``` -Defined in: [useLiveQuery.ts:262](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L262) +Defined in: [useLiveQuery.ts:236](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L236) Create a live query using a query function @@ -376,6 +384,8 @@ Create a live query using a query function ### Returns +`Accessor`\<`TResult` \| `undefined`\> & `object` & `LiveQueryStatusFlags` + Accessor that returns data with Suspense support, with state and status information as properties ### Examples diff --git a/docs/framework/svelte/reference/functions/useLiveQuery.md b/docs/framework/svelte/reference/functions/useLiveQuery.md index fe4ba50f4a..d32caf4fbf 100644 --- a/docs/framework/svelte/reference/functions/useLiveQuery.md +++ b/docs/framework/svelte/reference/functions/useLiveQuery.md @@ -9,7 +9,7 @@ title: useLiveQuery function useLiveQuery(queryFn, deps?): UseLiveQueryReturn<{ [K in string | number | symbol]: ResultValue[K] }, InferResultType>; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:221](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L221) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:203](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L203) Create a live query using a query function @@ -135,7 +135,7 @@ const todosQuery = useLiveQuery((q) => function useLiveQuery(queryFn, deps?): ConditionalUseLiveQueryReturn<{ [K in string | number | symbol]: ResultValue[K] }, InferConditionalResultType>; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:227](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L227) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:209](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L209) Create a live query using a query function @@ -261,7 +261,7 @@ const todosQuery = useLiveQuery((q) => function useLiveQuery(config, deps?): UseLiveQueryReturn<{ [K in string | number | symbol]: ResultValue[K] }, InferResultType>; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:275](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L275) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:257](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L257) Create a live query using configuration object @@ -334,7 +334,7 @@ const itemsQuery = useLiveQuery({ function useLiveQuery(liveQueryCollection): UseLiveQueryReturnWithCollection; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:324](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L324) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:306](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L306) Subscribe to an existing query collection (can be reactive) @@ -417,7 +417,7 @@ const queryResult = useLiveQuery(sharedQuery) function useLiveQuery(liveQueryCollection): UseLiveQueryReturnWithCollection; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:335](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L335) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:317](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L317) Create a live query using a query function diff --git a/docs/framework/svelte/reference/interfaces/UseLiveQueryReturn.md b/docs/framework/svelte/reference/interfaces/UseLiveQueryReturn.md index 41e8734f78..06184e58b8 100644 --- a/docs/framework/svelte/reference/interfaces/UseLiveQueryReturn.md +++ b/docs/framework/svelte/reference/interfaces/UseLiveQueryReturn.md @@ -3,10 +3,14 @@ id: UseLiveQueryReturn title: UseLiveQueryReturn --- -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:63](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L63) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:64](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L64) Return type for useLiveQuery hook +## Extends + +- `LiveQueryStatusFlags` + ## Type Parameters ### T @@ -26,7 +30,7 @@ collection: Collection; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:66](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L66) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:70](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L70) The underlying query collection instance @@ -38,103 +42,9 @@ The underlying query collection instance data: TData; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:65](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L65) - -Reactive array of query results in order, or single item when using findOne() - -*** - -### health - -```ts -health: HealthNode | undefined; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:78](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L78) - -*** - -### isCleanedUp - -```ts -isCleanedUp: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:75](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L75) - -True when query has been cleaned up - -*** - -### isCrashed - -```ts -isCrashed: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:74](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L74) - -True when local storage or an invariant broke - -*** - -### isIdle - -```ts -isIdle: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:70](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L70) - -True when query hasn't started yet - -*** - -### isLoading - -```ts -isLoading: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:68](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L68) - -True while initial query data is loading - -*** - -### isLoadingError - -```ts -isLoadingError: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:72](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L72) - -True when the first load failed - -*** - -### isReady - -```ts -isReady: boolean; -``` - Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:69](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L69) -True when query has received first data and is ready - -*** - -### isSyncError - -```ts -isSyncError: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:77](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L77) - -True when data is shown and `health` has a problem +Reactive array of query results in order, or single item when using findOne() *** @@ -144,7 +54,7 @@ True when data is shown and `health` has a problem state: Map; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:64](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L64) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:68](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L68) Reactive Map of query results (key → item) @@ -156,6 +66,6 @@ Reactive Map of query results (key → item) status: CollectionStatus; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:67](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L67) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:71](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L71) Current query status diff --git a/docs/framework/svelte/reference/interfaces/UseLiveQueryReturnWithCollection.md b/docs/framework/svelte/reference/interfaces/UseLiveQueryReturnWithCollection.md index 9d07c7de97..55429759ac 100644 --- a/docs/framework/svelte/reference/interfaces/UseLiveQueryReturnWithCollection.md +++ b/docs/framework/svelte/reference/interfaces/UseLiveQueryReturnWithCollection.md @@ -3,7 +3,11 @@ id: UseLiveQueryReturnWithCollection title: UseLiveQueryReturnWithCollection --- -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:94](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L94) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:87](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L87) + +## Extends + +- `LiveQueryStatusFlags` ## Type Parameters @@ -31,7 +35,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:94](https://github.co collection: Collection; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:102](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L102) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:95](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L95) *** @@ -41,93 +45,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:102](https://github.c data: TData; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:101](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L101) - -*** - -### health - -```ts -health: HealthNode | undefined; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:114](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L114) - -*** - -### isCleanedUp - -```ts -isCleanedUp: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:111](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L111) - -*** - -### isCrashed - -```ts -isCrashed: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:110](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L110) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. - -*** - -### isIdle - -```ts -isIdle: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:106](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L106) - -*** - -### isLoading - -```ts -isLoading: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:104](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L104) - -*** - -### isLoadingError - -```ts -isLoadingError: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:108](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L108) - -The first load failed: there is nothing to show. - -*** - -### isReady - -```ts -isReady: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:105](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L105) - -*** - -### isSyncError - -```ts -isSyncError: boolean; -``` - -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:113](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L113) - -The data is shown, and a sync problem or failed request is in `health`. +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:94](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L94) *** @@ -137,7 +55,7 @@ The data is shown, and a sync problem or failed request is in `health`. state: Map; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:100](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L100) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:93](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L93) *** @@ -147,4 +65,4 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:100](https://github.c status: CollectionStatus; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:103](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L103) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:96](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L96) diff --git a/docs/framework/svelte/reference/type-aliases/ConditionalUseLiveQueryReturn.md b/docs/framework/svelte/reference/type-aliases/ConditionalUseLiveQueryReturn.md index 3e42d719d1..34c7e1e499 100644 --- a/docs/framework/svelte/reference/type-aliases/ConditionalUseLiveQueryReturn.md +++ b/docs/framework/svelte/reference/type-aliases/ConditionalUseLiveQueryReturn.md @@ -7,7 +7,7 @@ title: ConditionalUseLiveQueryReturn type ConditionalUseLiveQueryReturn = Omit, "collection" | "status"> & object; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:86](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L86) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:79](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L79) ## Type Declaration diff --git a/docs/framework/svelte/reference/type-aliases/UseLiveQueryConfig.md b/docs/framework/svelte/reference/type-aliases/UseLiveQueryConfig.md index 847bd05f96..3904e0f12a 100644 --- a/docs/framework/svelte/reference/type-aliases/UseLiveQueryConfig.md +++ b/docs/framework/svelte/reference/type-aliases/UseLiveQueryConfig.md @@ -7,7 +7,7 @@ title: UseLiveQueryConfig type UseLiveQueryConfig = LiveQueryHookConfig & object; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:119](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L119) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:101](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L101) ## Type Declaration diff --git a/docs/framework/vue/reference/functions/useLiveInfiniteQuery.md b/docs/framework/vue/reference/functions/useLiveInfiniteQuery.md index 49e9dae5a1..0086490124 100644 --- a/docs/framework/vue/reference/functions/useLiveInfiniteQuery.md +++ b/docs/framework/vue/reference/functions/useLiveInfiniteQuery.md @@ -9,7 +9,7 @@ title: useLiveInfiniteQuery function useLiveInfiniteQuery(liveQueryCollection, config): UseLiveInfiniteQueryReturnWithCollection; ``` -Defined in: [useLiveInfiniteQuery.ts:93](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L93) +Defined in: [useLiveInfiniteQuery.ts:69](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L69) Create a Vue-native reactive view over the shared live-query window controller. The query must include an `orderBy` clause. @@ -51,7 +51,7 @@ function useLiveInfiniteQuery( deps?): UseLiveInfiniteQueryReturn; ``` -Defined in: [useLiveInfiniteQuery.ts:104](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L104) +Defined in: [useLiveInfiniteQuery.ts:80](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L80) Create a Vue-native reactive view over the shared live-query window controller. The query must include an `orderBy` clause. diff --git a/docs/framework/vue/reference/functions/useLiveQuery.md b/docs/framework/vue/reference/functions/useLiveQuery.md index 1bf87a28c7..762d3d3fad 100644 --- a/docs/framework/vue/reference/functions/useLiveQuery.md +++ b/docs/framework/vue/reference/functions/useLiveQuery.md @@ -9,7 +9,7 @@ title: useLiveQuery function useLiveQuery(queryFn, deps?): UseLiveQueryReturn; ``` -Defined in: [useLiveQuery.ts:168](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L168) +Defined in: [useLiveQuery.ts:161](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L161) Create a live query using a query function @@ -95,7 +95,7 @@ const { data, isLoading, isLoadingError, status } = useLiveQuery((q) => function useLiveQuery(queryFn, deps?): ConditionalUseLiveQueryReturn; ``` -Defined in: [useLiveQuery.ts:174](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L174) +Defined in: [useLiveQuery.ts:167](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L167) Create a live query using a query function @@ -181,7 +181,7 @@ const { data, isLoading, isLoadingError, status } = useLiveQuery((q) => function useLiveQuery(config, deps?): UseLiveQueryReturn; ``` -Defined in: [useLiveQuery.ts:214](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L214) +Defined in: [useLiveQuery.ts:207](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L207) Create a live query using configuration object @@ -249,7 +249,7 @@ const { data, isLoading, isReady, isLoadingError } = useLiveQuery({ function useLiveQuery(liveQueryCollection): UseLiveQueryReturnWithCollection; ``` -Defined in: [useLiveQuery.ts:259](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L259) +Defined in: [useLiveQuery.ts:252](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L252) Subscribe to an existing query collection (can be reactive) @@ -328,7 +328,7 @@ const { data, isLoading, isLoadingError } = useLiveQuery(sharedQuery) function useLiveQuery(liveQueryCollection): UseLiveQueryReturnWithSingleResultCollection; ``` -Defined in: [useLiveQuery.ts:270](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L270) +Defined in: [useLiveQuery.ts:263](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L263) Create a live query using a query function diff --git a/docs/framework/vue/reference/index.md b/docs/framework/vue/reference/index.md index 6b46272af3..7d7f7b1a4a 100644 --- a/docs/framework/vue/reference/index.md +++ b/docs/framework/vue/reference/index.md @@ -7,7 +7,6 @@ title: "@tanstack/vue-db" - [UseLiveInfiniteQueryReturn](interfaces/UseLiveInfiniteQueryReturn.md) - [UseLiveInfiniteQueryReturnWithCollection](interfaces/UseLiveInfiniteQueryReturnWithCollection.md) -- [UseLiveQueryFlags](interfaces/UseLiveQueryFlags.md) - [UseLiveQueryReturn](interfaces/UseLiveQueryReturn.md) - [UseLiveQueryReturnWithCollection](interfaces/UseLiveQueryReturnWithCollection.md) - [UseLiveQueryReturnWithSingleResultCollection](interfaces/UseLiveQueryReturnWithSingleResultCollection.md) @@ -17,6 +16,7 @@ title: "@tanstack/vue-db" - [ConditionalUseLiveQueryReturn](type-aliases/ConditionalUseLiveQueryReturn.md) - [LiveInfiniteQueryConfig](type-aliases/LiveInfiniteQueryConfig.md) - [UseLiveInfiniteQueryConfig](type-aliases/UseLiveInfiniteQueryConfig.md) +- [UseLiveQueryFlags](type-aliases/UseLiveQueryFlags.md) ## Functions diff --git a/docs/framework/vue/reference/interfaces/UseLiveInfiniteQueryReturn.md b/docs/framework/vue/reference/interfaces/UseLiveInfiniteQueryReturn.md index 1de47a8651..6b9c78fd3c 100644 --- a/docs/framework/vue/reference/interfaces/UseLiveInfiniteQueryReturn.md +++ b/docs/framework/vue/reference/interfaces/UseLiveInfiniteQueryReturn.md @@ -5,6 +5,12 @@ title: UseLiveInfiniteQueryReturn Defined in: [useLiveInfiniteQuery.ts:35](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L35) +The status and flag refs every `useLiveQuery` result has. + +## Extends + +- [`UseLiveQueryFlags`](../type-aliases/UseLiveQueryFlags.md) + ## Type Parameters ### TContext @@ -39,7 +45,7 @@ Defined in: [useLiveInfiniteQuery.ts:39](https://github.com/TanStack/db/blob/mai fetchNextPage: () => Promise; ``` -Defined in: [useLiveInfiniteQuery.ts:56](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L56) +Defined in: [useLiveInfiniteQuery.ts:45](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L45) #### Returns @@ -53,39 +59,7 @@ Defined in: [useLiveInfiniteQuery.ts:56](https://github.com/TanStack/db/blob/mai hasNextPage: ComputedRef; ``` -Defined in: [useLiveInfiniteQuery.ts:57](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L57) - -*** - -### health - -```ts -health: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:59](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L59) - -*** - -### isCleanedUp - -```ts -isCleanedUp: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:51](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L51) - -*** - -### isCrashed - -```ts -isCrashed: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:50](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L50) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. +Defined in: [useLiveInfiniteQuery.ts:46](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L46) *** @@ -95,61 +69,7 @@ Local storage or an invariant broke. Only a cascade cleanup and a fresh start re isFetchingNextPage: ComputedRef; ``` -Defined in: [useLiveInfiniteQuery.ts:58](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L58) - -*** - -### isIdle - -```ts -isIdle: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:46](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L46) - -*** - -### isLoading - -```ts -isLoading: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:44](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L44) - -*** - -### isLoadingError - -```ts -isLoadingError: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:48](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L48) - -The first load failed: there is nothing to show. - -*** - -### isReady - -```ts -isReady: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:45](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L45) - -*** - -### isSyncError - -```ts -isSyncError: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:53](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L53) - -The data is shown, and a sync problem or failed request is in `health`. +Defined in: [useLiveInfiniteQuery.ts:47](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L47) *** @@ -159,7 +79,7 @@ The data is shown, and a sync problem or failed request is in `health`. pageParams: ComputedRef; ``` -Defined in: [useLiveInfiniteQuery.ts:55](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L55) +Defined in: [useLiveInfiniteQuery.ts:44](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L44) *** @@ -169,7 +89,7 @@ Defined in: [useLiveInfiniteQuery.ts:55](https://github.com/TanStack/db/blob/mai pages: ComputedRef[number][][]>; ``` -Defined in: [useLiveInfiniteQuery.ts:54](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L54) +Defined in: [useLiveInfiniteQuery.ts:43](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L43) *** @@ -189,4 +109,10 @@ Defined in: [useLiveInfiniteQuery.ts:38](https://github.com/TanStack/db/blob/mai status: ComputedRef; ``` -Defined in: [useLiveInfiniteQuery.ts:43](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L43) +Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) + +#### Inherited from + +```ts +UseLiveQueryFlags.status +``` diff --git a/docs/framework/vue/reference/interfaces/UseLiveInfiniteQueryReturnWithCollection.md b/docs/framework/vue/reference/interfaces/UseLiveInfiniteQueryReturnWithCollection.md index 5d5f56cb35..9ac0d42751 100644 --- a/docs/framework/vue/reference/interfaces/UseLiveInfiniteQueryReturnWithCollection.md +++ b/docs/framework/vue/reference/interfaces/UseLiveInfiniteQueryReturnWithCollection.md @@ -3,7 +3,13 @@ id: UseLiveInfiniteQueryReturnWithCollection title: UseLiveInfiniteQueryReturnWithCollection --- -Defined in: [useLiveInfiniteQuery.ts:62](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L62) +Defined in: [useLiveInfiniteQuery.ts:50](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L50) + +The status and flag refs every `useLiveQuery` result has. + +## Extends + +- [`UseLiveQueryFlags`](../type-aliases/UseLiveQueryFlags.md) ## Type Parameters @@ -27,7 +33,7 @@ Defined in: [useLiveInfiniteQuery.ts:62](https://github.com/TanStack/db/blob/mai collection: ComputedRef, TResult>>; ``` -Defined in: [useLiveInfiniteQuery.ts:69](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L69) +Defined in: [useLiveInfiniteQuery.ts:57](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L57) *** @@ -37,7 +43,7 @@ Defined in: [useLiveInfiniteQuery.ts:69](https://github.com/TanStack/db/blob/mai data: ComputedRef; ``` -Defined in: [useLiveInfiniteQuery.ts:68](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L68) +Defined in: [useLiveInfiniteQuery.ts:56](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L56) *** @@ -47,7 +53,7 @@ Defined in: [useLiveInfiniteQuery.ts:68](https://github.com/TanStack/db/blob/mai fetchNextPage: () => Promise; ``` -Defined in: [useLiveInfiniteQuery.ts:83](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L83) +Defined in: [useLiveInfiniteQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L60) #### Returns @@ -61,39 +67,7 @@ Defined in: [useLiveInfiniteQuery.ts:83](https://github.com/TanStack/db/blob/mai hasNextPage: ComputedRef; ``` -Defined in: [useLiveInfiniteQuery.ts:84](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L84) - -*** - -### health - -```ts -health: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:86](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L86) - -*** - -### isCleanedUp - -```ts -isCleanedUp: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:78](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L78) - -*** - -### isCrashed - -```ts -isCrashed: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:77](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L77) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. +Defined in: [useLiveInfiniteQuery.ts:61](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L61) *** @@ -103,61 +77,7 @@ Local storage or an invariant broke. Only a cascade cleanup and a fresh start re isFetchingNextPage: ComputedRef; ``` -Defined in: [useLiveInfiniteQuery.ts:85](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L85) - -*** - -### isIdle - -```ts -isIdle: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:73](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L73) - -*** - -### isLoading - -```ts -isLoading: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:71](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L71) - -*** - -### isLoadingError - -```ts -isLoadingError: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:75](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L75) - -The first load failed: there is nothing to show. - -*** - -### isReady - -```ts -isReady: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:72](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L72) - -*** - -### isSyncError - -```ts -isSyncError: ComputedRef; -``` - -Defined in: [useLiveInfiniteQuery.ts:80](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L80) - -The data is shown, and a sync problem or failed request is in `health`. +Defined in: [useLiveInfiniteQuery.ts:62](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L62) *** @@ -167,7 +87,7 @@ The data is shown, and a sync problem or failed request is in `health`. pageParams: ComputedRef; ``` -Defined in: [useLiveInfiniteQuery.ts:82](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L82) +Defined in: [useLiveInfiniteQuery.ts:59](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L59) *** @@ -177,7 +97,7 @@ Defined in: [useLiveInfiniteQuery.ts:82](https://github.com/TanStack/db/blob/mai pages: ComputedRef; ``` -Defined in: [useLiveInfiniteQuery.ts:81](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L81) +Defined in: [useLiveInfiniteQuery.ts:58](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L58) *** @@ -187,7 +107,7 @@ Defined in: [useLiveInfiniteQuery.ts:81](https://github.com/TanStack/db/blob/mai state: ComputedRef>; ``` -Defined in: [useLiveInfiniteQuery.ts:67](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L67) +Defined in: [useLiveInfiniteQuery.ts:55](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L55) *** @@ -197,4 +117,10 @@ Defined in: [useLiveInfiniteQuery.ts:67](https://github.com/TanStack/db/blob/mai status: ComputedRef; ``` -Defined in: [useLiveInfiniteQuery.ts:70](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveInfiniteQuery.ts#L70) +Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) + +#### Inherited from + +```ts +UseLiveQueryFlags.status +``` diff --git a/docs/framework/vue/reference/interfaces/UseLiveQueryFlags.md b/docs/framework/vue/reference/interfaces/UseLiveQueryFlags.md deleted file mode 100644 index 14fe3b4b13..0000000000 --- a/docs/framework/vue/reference/interfaces/UseLiveQueryFlags.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -id: UseLiveQueryFlags -title: UseLiveQueryFlags ---- - -Defined in: [useLiveQuery.ts:57](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L57) - -Status, persistence, and error refs every `useLiveQuery` result has. - -## Extended by - -- [`UseLiveQueryReturn`](UseLiveQueryReturn.md) -- [`UseLiveQueryReturnWithCollection`](UseLiveQueryReturnWithCollection.md) -- [`UseLiveQueryReturnWithSingleResultCollection`](UseLiveQueryReturnWithSingleResultCollection.md) - -## Properties - -### health - -```ts -health: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:69](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L69) - -*** - -### isCleanedUp - -```ts -isCleanedUp: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:66](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L66) - -*** - -### isCrashed - -```ts -isCrashed: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:65](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L65) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. - -*** - -### isIdle - -```ts -isIdle: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:61](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L61) - -*** - -### isLoading - -```ts -isLoading: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:59](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L59) - -*** - -### isLoadingError - -```ts -isLoadingError: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:63](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L63) - -The first load failed: there is nothing to show. - -*** - -### isReady - -```ts -isReady: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) - -*** - -### isSyncError - -```ts -isSyncError: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:68](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L68) - -The data is shown, and a sync problem or failed request is in `health`. - -*** - -### status - -```ts -status: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:58](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L58) diff --git a/docs/framework/vue/reference/interfaces/UseLiveQueryReturn.md b/docs/framework/vue/reference/interfaces/UseLiveQueryReturn.md index a7834e9f93..a1f26c7777 100644 --- a/docs/framework/vue/reference/interfaces/UseLiveQueryReturn.md +++ b/docs/framework/vue/reference/interfaces/UseLiveQueryReturn.md @@ -3,13 +3,13 @@ id: UseLiveQueryReturn title: UseLiveQueryReturn --- -Defined in: [useLiveQuery.ts:72](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L72) +Defined in: [useLiveQuery.ts:65](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L65) -Status, persistence, and error refs every `useLiveQuery` result has. +The status and flag refs every `useLiveQuery` result has. ## Extends -- [`UseLiveQueryFlags`](UseLiveQueryFlags.md) +- [`UseLiveQueryFlags`](../type-aliases/UseLiveQueryFlags.md) ## Type Parameters @@ -26,7 +26,7 @@ collection: ComputedRef, { [K in string | number | symbol]: ResultValue[K] }>>; ``` -Defined in: [useLiveQuery.ts:77](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L77) +Defined in: [useLiveQuery.ts:70](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L70) *** @@ -36,126 +36,8 @@ Defined in: [useLiveQuery.ts:77](https://github.com/TanStack/db/blob/main/packag data: ComputedRef>; ``` -Defined in: [useLiveQuery.ts:76](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L76) - -*** - -### health - -```ts -health: ComputedRef; -``` - Defined in: [useLiveQuery.ts:69](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L69) -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`health`](UseLiveQueryFlags.md#health) - -*** - -### isCleanedUp - -```ts -isCleanedUp: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:66](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L66) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isCleanedUp`](UseLiveQueryFlags.md#iscleanedup) - -*** - -### isCrashed - -```ts -isCrashed: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:65](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L65) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isCrashed`](UseLiveQueryFlags.md#iscrashed) - -*** - -### isIdle - -```ts -isIdle: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:61](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L61) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isIdle`](UseLiveQueryFlags.md#isidle) - -*** - -### isLoading - -```ts -isLoading: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:59](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L59) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isLoading`](UseLiveQueryFlags.md#isloading) - -*** - -### isLoadingError - -```ts -isLoadingError: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:63](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L63) - -The first load failed: there is nothing to show. - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isLoadingError`](UseLiveQueryFlags.md#isloadingerror) - -*** - -### isReady - -```ts -isReady: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isReady`](UseLiveQueryFlags.md#isready) - -*** - -### isSyncError - -```ts -isSyncError: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:68](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L68) - -The data is shown, and a sync problem or failed request is in `health`. - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isSyncError`](UseLiveQueryFlags.md#issyncerror) - *** ### state @@ -164,7 +46,7 @@ The data is shown, and a sync problem or failed request is in `health`. state: ComputedRef[K] }>>; ``` -Defined in: [useLiveQuery.ts:75](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L75) +Defined in: [useLiveQuery.ts:68](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L68) *** @@ -174,8 +56,10 @@ Defined in: [useLiveQuery.ts:75](https://github.com/TanStack/db/blob/main/packag status: ComputedRef; ``` -Defined in: [useLiveQuery.ts:58](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L58) +Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) #### Inherited from -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`status`](UseLiveQueryFlags.md#status) +```ts +UseLiveQueryFlags.status +``` diff --git a/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithCollection.md b/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithCollection.md index af3ba691ea..45f24f9cda 100644 --- a/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithCollection.md +++ b/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithCollection.md @@ -3,13 +3,13 @@ id: UseLiveQueryReturnWithCollection title: UseLiveQueryReturnWithCollection --- -Defined in: [useLiveQuery.ts:98](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L98) +Defined in: [useLiveQuery.ts:91](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L91) -Status, persistence, and error refs every `useLiveQuery` result has. +The status and flag refs every `useLiveQuery` result has. ## Extends -- [`UseLiveQueryFlags`](UseLiveQueryFlags.md) +- [`UseLiveQueryFlags`](../type-aliases/UseLiveQueryFlags.md) ## Type Parameters @@ -33,7 +33,7 @@ Status, persistence, and error refs every `useLiveQuery` result has. collection: ComputedRef, T>>; ``` -Defined in: [useLiveQuery.ts:105](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L105) +Defined in: [useLiveQuery.ts:98](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L98) *** @@ -43,125 +43,7 @@ Defined in: [useLiveQuery.ts:105](https://github.com/TanStack/db/blob/main/packa data: ComputedRef; ``` -Defined in: [useLiveQuery.ts:104](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L104) - -*** - -### health - -```ts -health: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:69](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L69) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`health`](UseLiveQueryFlags.md#health) - -*** - -### isCleanedUp - -```ts -isCleanedUp: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:66](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L66) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isCleanedUp`](UseLiveQueryFlags.md#iscleanedup) - -*** - -### isCrashed - -```ts -isCrashed: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:65](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L65) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isCrashed`](UseLiveQueryFlags.md#iscrashed) - -*** - -### isIdle - -```ts -isIdle: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:61](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L61) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isIdle`](UseLiveQueryFlags.md#isidle) - -*** - -### isLoading - -```ts -isLoading: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:59](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L59) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isLoading`](UseLiveQueryFlags.md#isloading) - -*** - -### isLoadingError - -```ts -isLoadingError: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:63](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L63) - -The first load failed: there is nothing to show. - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isLoadingError`](UseLiveQueryFlags.md#isloadingerror) - -*** - -### isReady - -```ts -isReady: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isReady`](UseLiveQueryFlags.md#isready) - -*** - -### isSyncError - -```ts -isSyncError: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:68](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L68) - -The data is shown, and a sync problem or failed request is in `health`. - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isSyncError`](UseLiveQueryFlags.md#issyncerror) +Defined in: [useLiveQuery.ts:97](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L97) *** @@ -171,7 +53,7 @@ The data is shown, and a sync problem or failed request is in `health`. state: ComputedRef>; ``` -Defined in: [useLiveQuery.ts:103](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L103) +Defined in: [useLiveQuery.ts:96](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L96) *** @@ -181,8 +63,10 @@ Defined in: [useLiveQuery.ts:103](https://github.com/TanStack/db/blob/main/packa status: ComputedRef; ``` -Defined in: [useLiveQuery.ts:58](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L58) +Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) #### Inherited from -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`status`](UseLiveQueryFlags.md#status) +```ts +UseLiveQueryFlags.status +``` diff --git a/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithSingleResultCollection.md b/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithSingleResultCollection.md index 1a51882b20..a2b83c55e0 100644 --- a/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithSingleResultCollection.md +++ b/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithSingleResultCollection.md @@ -3,13 +3,13 @@ id: UseLiveQueryReturnWithSingleResultCollection title: UseLiveQueryReturnWithSingleResultCollection --- -Defined in: [useLiveQuery.ts:108](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L108) +Defined in: [useLiveQuery.ts:101](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L101) -Status, persistence, and error refs every `useLiveQuery` result has. +The status and flag refs every `useLiveQuery` result has. ## Extends -- [`UseLiveQueryFlags`](UseLiveQueryFlags.md) +- [`UseLiveQueryFlags`](../type-aliases/UseLiveQueryFlags.md) ## Type Parameters @@ -33,7 +33,7 @@ Status, persistence, and error refs every `useLiveQuery` result has. collection: ComputedRef, T> & SingleResult>; ``` -Defined in: [useLiveQuery.ts:115](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L115) +Defined in: [useLiveQuery.ts:108](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L108) *** @@ -43,125 +43,7 @@ Defined in: [useLiveQuery.ts:115](https://github.com/TanStack/db/blob/main/packa data: ComputedRef; ``` -Defined in: [useLiveQuery.ts:114](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L114) - -*** - -### health - -```ts -health: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:69](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L69) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`health`](UseLiveQueryFlags.md#health) - -*** - -### isCleanedUp - -```ts -isCleanedUp: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:66](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L66) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isCleanedUp`](UseLiveQueryFlags.md#iscleanedup) - -*** - -### isCrashed - -```ts -isCrashed: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:65](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L65) - -Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isCrashed`](UseLiveQueryFlags.md#iscrashed) - -*** - -### isIdle - -```ts -isIdle: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:61](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L61) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isIdle`](UseLiveQueryFlags.md#isidle) - -*** - -### isLoading - -```ts -isLoading: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:59](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L59) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isLoading`](UseLiveQueryFlags.md#isloading) - -*** - -### isLoadingError - -```ts -isLoadingError: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:63](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L63) - -The first load failed: there is nothing to show. - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isLoadingError`](UseLiveQueryFlags.md#isloadingerror) - -*** - -### isReady - -```ts -isReady: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isReady`](UseLiveQueryFlags.md#isready) - -*** - -### isSyncError - -```ts -isSyncError: ComputedRef; -``` - -Defined in: [useLiveQuery.ts:68](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L68) - -The data is shown, and a sync problem or failed request is in `health`. - -#### Inherited from - -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`isSyncError`](UseLiveQueryFlags.md#issyncerror) +Defined in: [useLiveQuery.ts:107](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L107) *** @@ -171,7 +53,7 @@ The data is shown, and a sync problem or failed request is in `health`. state: ComputedRef>; ``` -Defined in: [useLiveQuery.ts:113](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L113) +Defined in: [useLiveQuery.ts:106](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L106) *** @@ -181,8 +63,10 @@ Defined in: [useLiveQuery.ts:113](https://github.com/TanStack/db/blob/main/packa status: ComputedRef; ``` -Defined in: [useLiveQuery.ts:58](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L58) +Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) #### Inherited from -[`UseLiveQueryFlags`](UseLiveQueryFlags.md).[`status`](UseLiveQueryFlags.md#status) +```ts +UseLiveQueryFlags.status +``` diff --git a/docs/framework/vue/reference/type-aliases/ConditionalUseLiveQueryReturn.md b/docs/framework/vue/reference/type-aliases/ConditionalUseLiveQueryReturn.md index 4cf396068d..d77fa6dc08 100644 --- a/docs/framework/vue/reference/type-aliases/ConditionalUseLiveQueryReturn.md +++ b/docs/framework/vue/reference/type-aliases/ConditionalUseLiveQueryReturn.md @@ -7,7 +7,7 @@ title: ConditionalUseLiveQueryReturn type ConditionalUseLiveQueryReturn = Omit, "data" | "collection" | "status"> & object; ``` -Defined in: [useLiveQuery.ts:85](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L85) +Defined in: [useLiveQuery.ts:78](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L78) ## Type Declaration diff --git a/docs/framework/vue/reference/type-aliases/UseLiveQueryFlags.md b/docs/framework/vue/reference/type-aliases/UseLiveQueryFlags.md new file mode 100644 index 0000000000..ed74499322 --- /dev/null +++ b/docs/framework/vue/reference/type-aliases/UseLiveQueryFlags.md @@ -0,0 +1,20 @@ +--- +id: UseLiveQueryFlags +title: UseLiveQueryFlags +--- + +```ts +type UseLiveQueryFlags = object & { [K in keyof LiveQueryStatusFlags]: ComputedRef }; +``` + +Defined in: [useLiveQuery.ts:59](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L59) + +The status and flag refs every `useLiveQuery` result has. + +## Type Declaration + +### status + +```ts +status: ComputedRef; +``` diff --git a/docs/reference/classes/AggregateFunctionNotInSelectError.md b/docs/reference/classes/AggregateFunctionNotInSelectError.md index 6fd6bf97bd..4fa41634a1 100644 --- a/docs/reference/classes/AggregateFunctionNotInSelectError.md +++ b/docs/reference/classes/AggregateFunctionNotInSelectError.md @@ -3,7 +3,7 @@ id: AggregateFunctionNotInSelectError title: AggregateFunctionNotInSelectError --- -Defined in: [packages/db/src/errors.ts:1017](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1017) +Defined in: [packages/db/src/errors.ts:1003](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1003) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1017](https://github.com/TanStack/db/blob new AggregateFunctionNotInSelectError(functionName): AggregateFunctionNotInSelectError; ``` -Defined in: [packages/db/src/errors.ts:1018](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1018) +Defined in: [packages/db/src/errors.ts:1004](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1004) #### Parameters diff --git a/docs/reference/classes/CannotCombineEmptyExpressionListError.md b/docs/reference/classes/CannotCombineEmptyExpressionListError.md index 15c016c251..a7e2632389 100644 --- a/docs/reference/classes/CannotCombineEmptyExpressionListError.md +++ b/docs/reference/classes/CannotCombineEmptyExpressionListError.md @@ -3,7 +3,7 @@ id: CannotCombineEmptyExpressionListError title: CannotCombineEmptyExpressionListError --- -Defined in: [packages/db/src/errors.ts:1149](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1149) +Defined in: [packages/db/src/errors.ts:1135](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1135) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1149](https://github.com/TanStack/db/blob new CannotCombineEmptyExpressionListError(): CannotCombineEmptyExpressionListError; ``` -Defined in: [packages/db/src/errors.ts:1150](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1150) +Defined in: [packages/db/src/errors.ts:1136](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1136) #### Returns diff --git a/docs/reference/classes/CollectionImpl.md b/docs/reference/classes/CollectionImpl.md index 9329cd6b98..9603127408 100644 --- a/docs/reference/classes/CollectionImpl.md +++ b/docs/reference/classes/CollectionImpl.md @@ -203,7 +203,7 @@ Do not mutate the backing map or its rows: that bypasses publication. get compareOptions(): StringCollationConfig; ``` -Defined in: [packages/db/src/collection/index.ts:939](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L939) +Defined in: [packages/db/src/collection/index.ts:930](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L930) ##### Returns @@ -240,7 +240,7 @@ appear here and the rows stay. get indexes(): Map>; ``` -Defined in: [packages/db/src/collection/index.ts:924](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L924) +Defined in: [packages/db/src/collection/index.ts:915](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L915) Get resolved indexes for query optimization @@ -278,7 +278,7 @@ true if the collection has pending load more operations, false otherwise get size(): number; ``` -Defined in: [packages/db/src/collection/index.ts:789](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L789) +Defined in: [packages/db/src/collection/index.ts:780](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L780) Get the current size of the collection (cached) @@ -296,7 +296,7 @@ Get the current size of the collection (cached) get state(): Map>; ``` -Defined in: [packages/db/src/collection/index.ts:1116](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1116) +Defined in: [packages/db/src/collection/index.ts:1107](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1107) Gets the current state of the collection as a Map @@ -369,7 +369,7 @@ query that has no subscriber or preload of its own does not count. get subscribers(): readonly CollectionDependent[]; ``` -Defined in: [packages/db/src/collection/index.ts:1324](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1324) +Defined in: [packages/db/src/collection/index.ts:1317](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1317) Live queries, Effects, and direct subscriptions that read this Collection. `cleanup()` refuses while a live query or Effect reads it. @@ -388,7 +388,7 @@ readonly [`CollectionDependent`](../interfaces/CollectionDependent.md)[] get toArray(): WithVirtualProps[]; ``` -Defined in: [packages/db/src/collection/index.ts:1140](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1140) +Defined in: [packages/db/src/collection/index.ts:1131](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1131) Gets the current state of the collection as an Array @@ -456,7 +456,7 @@ A Collection this one depends on changed its health tree. _hasHeldSyncTransaction(): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:782](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L782) +Defined in: [packages/db/src/collection/index.ts:773](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L773) Whether an accepted sync transaction is not yet visible. @@ -494,7 +494,7 @@ Defined in: [packages/db/src/collection/index.ts:681](https://github.com/TanStac _hasOptimisticOverlay(key): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:774](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L774) +Defined in: [packages/db/src/collection/index.ts:765](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L765) Whether a local write obscures this key's authoritative source row. @@ -630,7 +630,7 @@ Listen for the first subscriber or preload in this sync run. _optimisticOverlaySize(): number; ``` -Defined in: [packages/db/src/collection/index.ts:767](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L767) +Defined in: [packages/db/src/collection/index.ts:758](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L758) Maximum number of source rows whose visible projection a local write can hide. @@ -706,31 +706,13 @@ Subscribe to layout-only publications. Internal observer channel. *** -### \_syncedRowMetadataKeysOutsideBase() - -```ts -_syncedRowMetadataKeysOutsideBase(): TKey[]; -``` - -Defined in: [packages/db/src/collection/index.ts:744](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L744) - -**`Internal`** - -Applied metadata keys without a source row. - -#### Returns - -`TKey`[] - -*** - ### \[iterator\]() ```ts iterator: IterableIterator<[TKey, WithVirtualProps]>; ``` -Defined in: [packages/db/src/collection/index.ts:827](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L827) +Defined in: [packages/db/src/collection/index.ts:818](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L818) Get all entries (virtual derived state) @@ -746,7 +728,7 @@ Get all entries (virtual derived state) cleanup(options?): Promise; ``` -Defined in: [packages/db/src/collection/index.ts:1358](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1358) +Defined in: [packages/db/src/collection/index.ts:1351](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1351) Clean up the collection by stopping sync and clearing data This can be called manually or automatically by garbage collection @@ -783,7 +765,7 @@ cleanup and asks for data again when a new sync run starts. createIndex(indexCallback, config): BaseIndex; ``` -Defined in: [packages/db/src/collection/index.ts:893](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L893) +Defined in: [packages/db/src/collection/index.ts:884](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L884) Creates an index on a collection for faster queries. Indexes significantly improve query performance by allowing constant time lookups @@ -839,7 +821,7 @@ currentStateAsChanges(options): | ChangeMessage, TKey>[]; ``` -Defined in: [packages/db/src/collection/index.ts:1173](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1173) +Defined in: [packages/db/src/collection/index.ts:1164](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1164) Returns the current state of the collection as an array of changes @@ -883,7 +865,7 @@ const activeChanges = collection.currentStateAsChanges({ delete(keys, config?): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1093](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1093) +Defined in: [packages/db/src/collection/index.ts:1084](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1084) Deletes one or more items from the collection @@ -946,7 +928,7 @@ try { entries(): IterableIterator<[TKey, WithVirtualProps]>; ``` -Defined in: [packages/db/src/collection/index.ts:815](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L815) +Defined in: [packages/db/src/collection/index.ts:806](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L806) Get all entries (virtual derived state) @@ -962,7 +944,7 @@ Get all entries (virtual derived state) forEach(callbackfn): void; ``` -Defined in: [packages/db/src/collection/index.ts:836](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L836) +Defined in: [packages/db/src/collection/index.ts:827](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L827) Execute a callback for each entry in the collection @@ -986,7 +968,7 @@ get(key): | undefined; ``` -Defined in: [packages/db/src/collection/index.ts:755](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L755) +Defined in: [packages/db/src/collection/index.ts:746](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L746) Get the current value for a key (virtual derived state) @@ -1009,7 +991,7 @@ Get the current value for a key (virtual derived state) getIndexMetadata(): CollectionIndexMetadata[]; ``` -Defined in: [packages/db/src/collection/index.ts:917](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L917) +Defined in: [packages/db/src/collection/index.ts:908](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L908) Returns a snapshot of current index metadata sorted by indexId. Persistence wrappers can use this to bootstrap index state if indexes were @@ -1027,7 +1009,7 @@ created before event listeners were attached. getKeyFromItem(item): TKey; ``` -Defined in: [packages/db/src/collection/index.ts:867](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L867) +Defined in: [packages/db/src/collection/index.ts:858](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L858) #### Parameters @@ -1047,7 +1029,7 @@ Defined in: [packages/db/src/collection/index.ts:867](https://github.com/TanStac has(key): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:762](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L762) +Defined in: [packages/db/src/collection/index.ts:753](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L753) Check if a key exists in the collection (virtual derived state) @@ -1071,7 +1053,7 @@ insert(data, config?): | Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:980](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L980) +Defined in: [packages/db/src/collection/index.ts:971](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L971) Inserts one or more items into the collection @@ -1172,7 +1154,7 @@ if (collection.isReady()) { keys(): IterableIterator; ``` -Defined in: [packages/db/src/collection/index.ts:796](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L796) +Defined in: [packages/db/src/collection/index.ts:787](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L787) Get all keys (virtual derived state) @@ -1188,7 +1170,7 @@ Get all keys (virtual derived state) map(callbackfn): U[]; ``` -Defined in: [packages/db/src/collection/index.ts:852](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L852) +Defined in: [packages/db/src/collection/index.ts:843](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L843) Create a new array with the results of calling a function for each entry in the collection @@ -1216,7 +1198,7 @@ Create a new array with the results of calling a function for each entry in the off(event, callback): void; ``` -Defined in: [packages/db/src/collection/index.ts:1284](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1284) +Defined in: [packages/db/src/collection/index.ts:1275](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1275) Unsubscribe from a collection event @@ -1262,7 +1244,7 @@ Unsubscribe from a collection event on(event, callback): () => void; ``` -Defined in: [packages/db/src/collection/index.ts:1264](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1264) +Defined in: [packages/db/src/collection/index.ts:1255](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1255) Subscribe to a collection event @@ -1314,7 +1296,7 @@ Subscribe to a collection event once(event, callback): () => void; ``` -Defined in: [packages/db/src/collection/index.ts:1274](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1274) +Defined in: [packages/db/src/collection/index.ts:1265](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1265) Subscribe to a collection event once @@ -1428,14 +1410,16 @@ Multiple concurrent calls will share the same promise reload(): Promise; ``` -Defined in: [packages/db/src/collection/index.ts:1315](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1315) +Defined in: [packages/db/src/collection/index.ts:1308](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1308) Start a new sync run while everything visible stays: the rows, the status, and the current error, with `reloading` on this Collection's -health node. The new run's first commit replaces the rows at once and -clears the node's problem; a `status` of `error` becomes `ready`. If the -new run fails first, the rows and status stay and the node shows the new -error. On a live query, it reloads each of its sources that has an +health node. The new run's writes apply on the kept rows; its snapshot +(`begin({ snapshot: true })`) or truncate replaces them at once. The +reload completes when that replacement applies, or at the new run's +`markReady()`, and the node drops the old run's problems; a `status` of +`error` becomes `ready` at `markReady()`. If the new run fails first, the +rows and status stay and the node shows the new error. On a live query, it reloads each of its sources that has an `error`, and then the query itself if its own node has an `error`: a failed first load or a failed request for more data. @@ -1455,7 +1439,7 @@ Collection up with its dependents to start it fresh. removeIndex(indexOrId): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:908](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L908) +Defined in: [packages/db/src/collection/index.ts:899](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L899) Removes an index created with createIndex. Returns true when an index existed and was removed. @@ -1500,7 +1484,7 @@ Throws during active cleanup; restart after cleanup completes instead. stateWhenReady(): Promise>>; ``` -Defined in: [packages/db/src/collection/index.ts:1131](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1131) +Defined in: [packages/db/src/collection/index.ts:1122](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1122) Gets the current state of the collection as a Map once the collection is ready Resolves when `preload()` does. For a live query, that is initial-query @@ -1522,7 +1506,7 @@ Promise that resolves to a Map containing all items in the collection subscribeChanges(callback, options?): CollectionSubscription; ``` -Defined in: [packages/db/src/collection/index.ts:1227](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1227) +Defined in: [packages/db/src/collection/index.ts:1218](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1218) Subscribe to changes in the collection Ordinary subscriptions throw during active cleanup. Wait for cleanup() @@ -1599,7 +1583,7 @@ const subscription = collection.subscribeChanges((changes) => { subscribeChanges(callback, options?): CollectionSubscription; ``` -Defined in: [packages/db/src/collection/index.ts:1235](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1235) +Defined in: [packages/db/src/collection/index.ts:1226](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1226) Subscribe to changes in the collection Ordinary subscriptions throw during active cleanup. Wait for cleanup() @@ -1678,7 +1662,7 @@ const subscription = collection.subscribeChanges((changes) => { toArrayWhenReady(): Promise[]>; ``` -Defined in: [packages/db/src/collection/index.ts:1151](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1151) +Defined in: [packages/db/src/collection/index.ts:1142](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1142) Gets the current state of the collection as an Array once the collection is ready Resolves when `preload()` does. For a live query, that is initial-query @@ -1700,7 +1684,7 @@ Promise that resolves to an Array containing all items in the collection update(key, callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1025](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1025) +Defined in: [packages/db/src/collection/index.ts:1016](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1016) Updates one or more items in the collection using a callback function @@ -1771,7 +1755,7 @@ update( callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1031](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1031) +Defined in: [packages/db/src/collection/index.ts:1022](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1022) Updates one or more items in the collection using a callback function @@ -1845,7 +1829,7 @@ try { update(id, callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1038](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1038) +Defined in: [packages/db/src/collection/index.ts:1029](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1029) Updates one or more items in the collection using a callback function @@ -1916,7 +1900,7 @@ update( callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1044](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1044) +Defined in: [packages/db/src/collection/index.ts:1035](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1035) Updates one or more items in the collection using a callback function @@ -1993,7 +1977,7 @@ validateData( key?): TOutput; ``` -Defined in: [packages/db/src/collection/index.ts:931](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L931) +Defined in: [packages/db/src/collection/index.ts:922](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L922) Validates the data against the schema @@ -2023,7 +2007,7 @@ Validates the data against the schema values(): IterableIterator>; ``` -Defined in: [packages/db/src/collection/index.ts:803](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L803) +Defined in: [packages/db/src/collection/index.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L794) Get all values (virtual derived state) @@ -2039,7 +2023,7 @@ Get all values (virtual derived state) waitFor(event, timeout?): Promise; ``` -Defined in: [packages/db/src/collection/index.ts:1294](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1294) +Defined in: [packages/db/src/collection/index.ts:1285](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1285) Wait for a collection event diff --git a/docs/reference/classes/CollectionInputNotFoundError.md b/docs/reference/classes/CollectionInputNotFoundError.md index 53db9f4bbd..daa8bd2ab7 100644 --- a/docs/reference/classes/CollectionInputNotFoundError.md +++ b/docs/reference/classes/CollectionInputNotFoundError.md @@ -3,7 +3,7 @@ id: CollectionInputNotFoundError title: CollectionInputNotFoundError --- -Defined in: [packages/db/src/errors.ts:816](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L816) +Defined in: [packages/db/src/errors.ts:821](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L821) Error thrown when a collection input stream is not found during query compilation. In self-joins, each alias (e.g., 'employee', 'manager') requires its own input stream. @@ -23,7 +23,7 @@ new CollectionInputNotFoundError( availableKeys?): CollectionInputNotFoundError; ``` -Defined in: [packages/db/src/errors.ts:817](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L817) +Defined in: [packages/db/src/errors.ts:822](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L822) #### Parameters diff --git a/docs/reference/classes/CollectionPreloadAbortedError.md b/docs/reference/classes/CollectionPreloadAbortedError.md index 6c0c6dcf5f..2031b16183 100644 --- a/docs/reference/classes/CollectionPreloadAbortedError.md +++ b/docs/reference/classes/CollectionPreloadAbortedError.md @@ -3,7 +3,7 @@ id: CollectionPreloadAbortedError title: CollectionPreloadAbortedError --- -Defined in: [packages/db/src/errors.ts:1118](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1118) +Defined in: [packages/db/src/errors.ts:1104](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1104) A collection was cleaned up before its initial preload became ready. @@ -19,7 +19,7 @@ A collection was cleaned up before its initial preload became ready. new CollectionPreloadAbortedError(): CollectionPreloadAbortedError; ``` -Defined in: [packages/db/src/errors.ts:1119](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1119) +Defined in: [packages/db/src/errors.ts:1105](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1105) #### Returns diff --git a/docs/reference/classes/DbClient.md b/docs/reference/classes/DbClient.md index a8fa9d91ce..f3190a19c9 100644 --- a/docs/reference/classes/DbClient.md +++ b/docs/reference/classes/DbClient.md @@ -3,7 +3,7 @@ id: DbClient title: DbClient --- -Defined in: [packages/db/src/client.ts:348](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L348) +Defined in: [packages/db/src/client.ts:411](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L411) ## Constructors @@ -13,7 +13,7 @@ Defined in: [packages/db/src/client.ts:348](https://github.com/TanStack/db/blob/ new DbClient(options): DbClient; ``` -Defined in: [packages/db/src/client.ts:375](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L375) +Defined in: [packages/db/src/client.ts:438](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L438) #### Parameters @@ -37,7 +37,7 @@ get activeTransaction(): | undefined; ``` -Defined in: [packages/db/src/client.ts:393](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L393) +Defined in: [packages/db/src/client.ts:456](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L456) ##### Returns @@ -49,14 +49,17 @@ Defined in: [packages/db/src/client.ts:393](https://github.com/TanStack/db/blob/ ### \_assertLiveQuerySources() ```ts -_assertLiveQuerySources(queryHash, sources): void; +_assertLiveQuerySources( + queryHash, + sources, + rowOptions?): void; ``` -Defined in: [packages/db/src/client.ts:831](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L831) +Defined in: [packages/db/src/client.ts:896](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L896) **`Internal`** -Reject a local stream whose hash already names different sources. +Reject incompatible local sources or row behavior for a reusable stream. #### Parameters @@ -68,6 +71,10 @@ Reject a local stream whose hash already names different sources. readonly `AnyCollection`[] +##### rowOptions? + +`LiveQueryRowOptions` + #### Returns `void` @@ -84,7 +91,7 @@ _bindLiveQueryObserver( host): LiveQueryObserverClient; ``` -Defined in: [packages/db/src/client.ts:729](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L729) +Defined in: [packages/db/src/client.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L794) **`Internal`** @@ -130,10 +137,11 @@ Supply transport behavior without coupling ordinary observers to SSR. _captureServerQuery( queryHash, snapshot, - sources?): void; + sources?, + rowOptions?): void; ``` -Defined in: [packages/db/src/client.ts:861](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L861) +Defined in: [packages/db/src/client.ts:935](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L935) **`Internal`** @@ -153,6 +161,10 @@ Capture the first server view without starting acquisition. readonly `AnyCollection`[] +##### rowOptions? + +`LiveQueryRowOptions` + #### Returns `void` @@ -165,7 +177,7 @@ readonly `AnyCollection`[] _consumeLiveQueryResult(queryHash, dehydratedAt): void; ``` -Defined in: [packages/db/src/client.ts:853](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L853) +Defined in: [packages/db/src/client.ts:927](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L927) **`Internal`** @@ -191,7 +203,7 @@ Defined in: [packages/db/src/client.ts:853](https://github.com/TanStack/db/blob/ _failPendingLiveQueries(error): void; ``` -Defined in: [packages/db/src/client.ts:939](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L939) +Defined in: [packages/db/src/client.ts:1017](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L1017) **`Internal`** @@ -213,7 +225,7 @@ Defined in: [packages/db/src/client.ts:939](https://github.com/TanStack/db/blob/ _getLiveQuery(queryHash, forServerSnapshot): DbClientLiveQuery | undefined; ``` -Defined in: [packages/db/src/client.ts:820](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L820) +Defined in: [packages/db/src/client.ts:885](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L885) **`Internal`** @@ -239,7 +251,7 @@ Defined in: [packages/db/src/client.ts:820](https://github.com/TanStack/db/blob/ _hasSsrCollectionSnapshot(collection): boolean; ``` -Defined in: [packages/db/src/client.ts:745](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L745) +Defined in: [packages/db/src/client.ts:810](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L810) **`Internal`** @@ -263,7 +275,7 @@ Normalized source transport carries rows, not readiness. _isSsrServerCleanupEnabled(): boolean; ``` -Defined in: [packages/db/src/client.ts:815](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L815) +Defined in: [packages/db/src/client.ts:880](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L880) **`Internal`** @@ -279,7 +291,7 @@ Defined in: [packages/db/src/client.ts:815](https://github.com/TanStack/db/blob/ _isSsrStreamingEnabled(): boolean; ``` -Defined in: [packages/db/src/client.ts:805](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L805) +Defined in: [packages/db/src/client.ts:870](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L870) **`Internal`** @@ -295,7 +307,7 @@ Defined in: [packages/db/src/client.ts:805](https://github.com/TanStack/db/blob/ _materializeCollectionForRender(options): Collection>; ``` -Defined in: [packages/db/src/client.ts:541](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L541) +Defined in: [packages/db/src/client.ts:606](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L606) **`Internal`** @@ -335,10 +347,11 @@ Defined in: [packages/db/src/client.ts:541](https://github.com/TanStack/db/blob/ _registerLiveQuery( queryHash, promise, -sources?): Promise; + sources?, +rowOptions?): Promise; ``` -Defined in: [packages/db/src/client.ts:894](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L894) +Defined in: [packages/db/src/client.ts:970](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L970) **`Internal`** @@ -356,6 +369,10 @@ Defined in: [packages/db/src/client.ts:894](https://github.com/TanStack/db/blob/ readonly `AnyCollection`[] +##### rowOptions? + +`LiveQueryRowOptions` + #### Returns `Promise`\<`void`\> @@ -368,7 +385,7 @@ readonly `AnyCollection`[] _registerLiveQueryResource(owner, cleanup): () => void; ``` -Defined in: [packages/db/src/client.ts:926](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L926) +Defined in: [packages/db/src/client.ts:1004](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L1004) **`Internal`** @@ -400,7 +417,7 @@ Defined in: [packages/db/src/client.ts:926](https://github.com/TanStack/db/blob/ _setSsrServerCleanupEnabled(enabled): void; ``` -Defined in: [packages/db/src/client.ts:810](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L810) +Defined in: [packages/db/src/client.ts:875](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L875) **`Internal`** @@ -422,7 +439,7 @@ Defined in: [packages/db/src/client.ts:810](https://github.com/TanStack/db/blob/ _setSsrStreamingEnabled(enabled): void; ``` -Defined in: [packages/db/src/client.ts:759](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L759) +Defined in: [packages/db/src/client.ts:824](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L824) **`Internal`** @@ -444,7 +461,7 @@ Defined in: [packages/db/src/client.ts:759](https://github.com/TanStack/db/blob/ _waitForSsrLiveQuery(queryHash, forHydration): Promise | undefined; ``` -Defined in: [packages/db/src/client.ts:775](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L775) +Defined in: [packages/db/src/client.ts:840](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L840) **`Internal`** @@ -472,7 +489,7 @@ Wait for transport without claiming or starting a local source. applyCollectionChunk(chunk): void; ``` -Defined in: [packages/db/src/client.ts:719](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L719) +Defined in: [packages/db/src/client.ts:784](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L784) #### Parameters @@ -492,7 +509,7 @@ Defined in: [packages/db/src/client.ts:719](https://github.com/TanStack/db/blob/ cleanup(): Promise; ``` -Defined in: [packages/db/src/client.ts:947](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L947) +Defined in: [packages/db/src/client.ts:1025](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L1025) #### Returns @@ -508,7 +525,7 @@ Defined in: [packages/db/src/client.ts:947](https://github.com/TanStack/db/blob/ collection(options, materializeOptions?): Collection, TKey, TUtils, T, InferSchemaInput> & NonSingleResult; ``` -Defined in: [packages/db/src/client.ts:497](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L497) +Defined in: [packages/db/src/client.ts:562](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L562) ##### Type Parameters @@ -544,7 +561,7 @@ Defined in: [packages/db/src/client.ts:497](https://github.com/TanStack/db/blob/ collection(options, materializeOptions?): Collection, TKey, TUtils, T, InferSchemaInput> & SingleResult; ``` -Defined in: [packages/db/src/client.ts:507](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L507) +Defined in: [packages/db/src/client.ts:572](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L572) ##### Type Parameters @@ -580,7 +597,7 @@ Defined in: [packages/db/src/client.ts:507](https://github.com/TanStack/db/blob/ collection(options, materializeOptions?): Collection & NonSingleResult; ``` -Defined in: [packages/db/src/client.ts:517](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L517) +Defined in: [packages/db/src/client.ts:582](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L582) ##### Type Parameters @@ -616,7 +633,7 @@ Defined in: [packages/db/src/client.ts:517](https://github.com/TanStack/db/blob/ collection(options, materializeOptions?): Collection & SingleResult; ``` -Defined in: [packages/db/src/client.ts:525](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L525) +Defined in: [packages/db/src/client.ts:590](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L590) ##### Type Parameters @@ -654,7 +671,7 @@ Defined in: [packages/db/src/client.ts:525](https://github.com/TanStack/db/blob/ createTransaction(config): Transaction; ``` -Defined in: [packages/db/src/client.ts:397](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L397) +Defined in: [packages/db/src/client.ts:460](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L460) #### Type Parameters @@ -680,7 +697,7 @@ Defined in: [packages/db/src/client.ts:397](https://github.com/TanStack/db/blob/ dehydrate(options): DehydratedDbState; ``` -Defined in: [packages/db/src/client.ts:632](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L632) +Defined in: [packages/db/src/client.ts:697](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L697) #### Parameters @@ -700,7 +717,7 @@ Defined in: [packages/db/src/client.ts:632](https://github.com/TanStack/db/blob/ getDependency(key): T | undefined; ``` -Defined in: [packages/db/src/client.ts:377](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L377) +Defined in: [packages/db/src/client.ts:440](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L440) #### Type Parameters @@ -726,7 +743,7 @@ Defined in: [packages/db/src/client.ts:377](https://github.com/TanStack/db/blob/ hydrate(state): void; ``` -Defined in: [packages/db/src/client.ts:700](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L700) +Defined in: [packages/db/src/client.ts:765](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L765) #### Parameters @@ -746,7 +763,7 @@ Defined in: [packages/db/src/client.ts:700](https://github.com/TanStack/db/blob/ preloadLiveQuery(options): Promise; ``` -Defined in: [packages/db/src/client.ts:403](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L403) +Defined in: [packages/db/src/client.ts:466](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L466) #### Parameters @@ -766,7 +783,7 @@ Defined in: [packages/db/src/client.ts:403](https://github.com/TanStack/db/blob/ requireDependency(key): T; ``` -Defined in: [packages/db/src/client.ts:381](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L381) +Defined in: [packages/db/src/client.ts:444](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L444) #### Type Parameters @@ -792,7 +809,7 @@ Defined in: [packages/db/src/client.ts:381](https://github.com/TanStack/db/blob/ subscribe(listener): () => void; ``` -Defined in: [packages/db/src/client.ts:723](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L723) +Defined in: [packages/db/src/client.ts:788](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L788) #### Parameters diff --git a/docs/reference/classes/DebounceCallDroppedError.md b/docs/reference/classes/DebounceCallDroppedError.md index de9c53d156..a5e0a8a5df 100644 --- a/docs/reference/classes/DebounceCallDroppedError.md +++ b/docs/reference/classes/DebounceCallDroppedError.md @@ -3,7 +3,7 @@ id: DebounceCallDroppedError title: DebounceCallDroppedError --- -Defined in: [packages/db/src/errors.ts:466](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L466) +Defined in: [packages/db/src/errors.ts:471](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L471) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:466](https://github.com/TanStack/db/blob/ new DebounceCallDroppedError(): DebounceCallDroppedError; ``` -Defined in: [packages/db/src/errors.ts:467](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L467) +Defined in: [packages/db/src/errors.ts:472](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L472) #### Returns diff --git a/docs/reference/classes/DeleteKeyNotFoundError.md b/docs/reference/classes/DeleteKeyNotFoundError.md index 9de46d62cb..de89cff754 100644 --- a/docs/reference/classes/DeleteKeyNotFoundError.md +++ b/docs/reference/classes/DeleteKeyNotFoundError.md @@ -3,7 +3,7 @@ id: DeleteKeyNotFoundError title: DeleteKeyNotFoundError --- -Defined in: [packages/db/src/errors.ts:366](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L366) +Defined in: [packages/db/src/errors.ts:371](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L371) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:366](https://github.com/TanStack/db/blob/ new DeleteKeyNotFoundError(key): DeleteKeyNotFoundError; ``` -Defined in: [packages/db/src/errors.ts:367](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L367) +Defined in: [packages/db/src/errors.ts:372](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L372) #### Parameters diff --git a/docs/reference/classes/DistinctRequiresSelectError.md b/docs/reference/classes/DistinctRequiresSelectError.md index f7a699426e..fdfb4e57d2 100644 --- a/docs/reference/classes/DistinctRequiresSelectError.md +++ b/docs/reference/classes/DistinctRequiresSelectError.md @@ -3,7 +3,7 @@ id: DistinctRequiresSelectError title: DistinctRequiresSelectError --- -Defined in: [packages/db/src/errors.ts:736](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L736) +Defined in: [packages/db/src/errors.ts:741](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L741) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:736](https://github.com/TanStack/db/blob/ new DistinctRequiresSelectError(): DistinctRequiresSelectError; ``` -Defined in: [packages/db/src/errors.ts:737](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L737) +Defined in: [packages/db/src/errors.ts:742](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L742) #### Returns diff --git a/docs/reference/classes/DuplicateAliasInSubqueryError.md b/docs/reference/classes/DuplicateAliasInSubqueryError.md deleted file mode 100644 index 4f6efc4417..0000000000 --- a/docs/reference/classes/DuplicateAliasInSubqueryError.md +++ /dev/null @@ -1,229 +0,0 @@ ---- -id: DuplicateAliasInSubqueryError -title: DuplicateAliasInSubqueryError ---- - -Defined in: [packages/db/src/errors.ts:848](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L848) - -Retained for callers that imported this formerly thrown error. - -## Deprecated - -Nested queries may now shadow ancestor aliases. Duplicate aliases -are rejected only within one lexical scope or union branch namespace. - -## Extends - -- [`QueryCompilationError`](QueryCompilationError.md) - -## Constructors - -### Constructor - -```ts -new DuplicateAliasInSubqueryError(alias, parentAliases): DuplicateAliasInSubqueryError; -``` - -Defined in: [packages/db/src/errors.ts:849](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L849) - -#### Parameters - -##### alias - -`string` - -##### parentAliases - -`string`[] - -#### Returns - -`DuplicateAliasInSubqueryError` - -#### Overrides - -[`QueryCompilationError`](QueryCompilationError.md).[`constructor`](QueryCompilationError.md#constructor) - -## Properties - -### ~~cause?~~ - -```ts -optional cause: unknown; -``` - -Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:26 - -#### Inherited from - -[`QueryCompilationError`](QueryCompilationError.md).[`cause`](QueryCompilationError.md#cause) - -*** - -### ~~message~~ - -```ts -message: string; -``` - -Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1077 - -#### Inherited from - -[`QueryCompilationError`](QueryCompilationError.md).[`message`](QueryCompilationError.md#message) - -*** - -### ~~name~~ - -```ts -name: string; -``` - -Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 - -#### Inherited from - -[`QueryCompilationError`](QueryCompilationError.md).[`name`](QueryCompilationError.md#name) - -*** - -### ~~stack?~~ - -```ts -optional stack: string; -``` - -Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1078 - -#### Inherited from - -[`QueryCompilationError`](QueryCompilationError.md).[`stack`](QueryCompilationError.md#stack) - -*** - -### ~~stackTraceLimit~~ - -```ts -static stackTraceLimit: number; -``` - -Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:67 - -The `Error.stackTraceLimit` property specifies the number of stack frames -collected by a stack trace (whether generated by `new Error().stack` or -`Error.captureStackTrace(obj)`). - -The default value is `10` but may be set to any valid JavaScript number. Changes -will affect any stack trace captured _after_ the value has been changed. - -If set to a non-number value, or set to a negative number, stack traces will -not capture any frames. - -#### Inherited from - -[`QueryCompilationError`](QueryCompilationError.md).[`stackTraceLimit`](QueryCompilationError.md#stacktracelimit) - -## Methods - -### ~~captureStackTrace()~~ - -```ts -static captureStackTrace(targetObject, constructorOpt?): void; -``` - -Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:51 - -Creates a `.stack` property on `targetObject`, which when accessed returns -a string representing the location in the code at which -`Error.captureStackTrace()` was called. - -```js -const myObject = {}; -Error.captureStackTrace(myObject); -myObject.stack; // Similar to `new Error().stack` -``` - -The first line of the trace will be prefixed with -`${myObject.name}: ${myObject.message}`. - -The optional `constructorOpt` argument accepts a function. If given, all frames -above `constructorOpt`, including `constructorOpt`, will be omitted from the -generated stack trace. - -The `constructorOpt` argument is useful for hiding implementation -details of error generation from the user. For instance: - -```js -function a() { - b(); -} - -function b() { - c(); -} - -function c() { - // Create an error without stack trace to avoid calculating the stack trace twice. - const { stackTraceLimit } = Error; - Error.stackTraceLimit = 0; - const error = new Error(); - Error.stackTraceLimit = stackTraceLimit; - - // Capture the stack trace above function b - Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace - throw error; -} - -a(); -``` - -#### Parameters - -##### targetObject - -`object` - -##### constructorOpt? - -`Function` - -#### Returns - -`void` - -#### Inherited from - -[`QueryCompilationError`](QueryCompilationError.md).[`captureStackTrace`](QueryCompilationError.md#capturestacktrace) - -*** - -### ~~prepareStackTrace()~~ - -```ts -static prepareStackTrace(err, stackTraces): any; -``` - -Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:55 - -#### Parameters - -##### err - -`Error` - -##### stackTraces - -`CallSite`[] - -#### Returns - -`any` - -#### See - -https://v8.dev/docs/stack-trace-api#customizing-stack-traces - -#### Inherited from - -[`QueryCompilationError`](QueryCompilationError.md).[`prepareStackTrace`](QueryCompilationError.md#preparestacktrace) diff --git a/docs/reference/classes/DuplicateKeyError.md b/docs/reference/classes/DuplicateKeyError.md index 7857a86188..38c1c98344 100644 --- a/docs/reference/classes/DuplicateKeyError.md +++ b/docs/reference/classes/DuplicateKeyError.md @@ -3,7 +3,7 @@ id: DuplicateKeyError title: DuplicateKeyError --- -Defined in: [packages/db/src/errors.ts:260](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L260) +Defined in: [packages/db/src/errors.ts:265](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L265) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:260](https://github.com/TanStack/db/blob/ new DuplicateKeyError(key): DuplicateKeyError; ``` -Defined in: [packages/db/src/errors.ts:261](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L261) +Defined in: [packages/db/src/errors.ts:266](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L266) #### Parameters diff --git a/docs/reference/classes/DuplicateKeySyncError.md b/docs/reference/classes/DuplicateKeySyncError.md index 60e2e77a14..d9dbc72f5e 100644 --- a/docs/reference/classes/DuplicateKeySyncError.md +++ b/docs/reference/classes/DuplicateKeySyncError.md @@ -3,7 +3,7 @@ id: DuplicateKeySyncError title: DuplicateKeySyncError --- -Defined in: [packages/db/src/errors.ts:270](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L270) +Defined in: [packages/db/src/errors.ts:275](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L275) ## Extends @@ -20,7 +20,7 @@ new DuplicateKeySyncError( options?): DuplicateKeySyncError; ``` -Defined in: [packages/db/src/errors.ts:271](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L271) +Defined in: [packages/db/src/errors.ts:276](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L276) #### Parameters diff --git a/docs/reference/classes/DuplicateTransactionIdError.md b/docs/reference/classes/DuplicateTransactionIdError.md index 5df8a608c0..d08959e180 100644 --- a/docs/reference/classes/DuplicateTransactionIdError.md +++ b/docs/reference/classes/DuplicateTransactionIdError.md @@ -3,7 +3,7 @@ id: DuplicateTransactionIdError title: DuplicateTransactionIdError --- -Defined in: [packages/db/src/errors.ts:518](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L518) +Defined in: [packages/db/src/errors.ts:523](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L523) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:518](https://github.com/TanStack/db/blob/ new DuplicateTransactionIdError(id): DuplicateTransactionIdError; ``` -Defined in: [packages/db/src/errors.ts:519](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L519) +Defined in: [packages/db/src/errors.ts:524](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L524) #### Parameters diff --git a/docs/reference/classes/EmptyReferencePathError.md b/docs/reference/classes/EmptyReferencePathError.md index 45b913499e..e6cbb47eee 100644 --- a/docs/reference/classes/EmptyReferencePathError.md +++ b/docs/reference/classes/EmptyReferencePathError.md @@ -3,7 +3,7 @@ id: EmptyReferencePathError title: EmptyReferencePathError --- -Defined in: [packages/db/src/errors.ts:881](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L881) +Defined in: [packages/db/src/errors.ts:867](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L867) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:881](https://github.com/TanStack/db/blob/ new EmptyReferencePathError(): EmptyReferencePathError; ``` -Defined in: [packages/db/src/errors.ts:882](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L882) +Defined in: [packages/db/src/errors.ts:868](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L868) #### Returns diff --git a/docs/reference/classes/FnSelectWithGroupByError.md b/docs/reference/classes/FnSelectWithGroupByError.md index 574d251c0c..5eb5456879 100644 --- a/docs/reference/classes/FnSelectWithGroupByError.md +++ b/docs/reference/classes/FnSelectWithGroupByError.md @@ -3,7 +3,7 @@ id: FnSelectWithGroupByError title: FnSelectWithGroupByError --- -Defined in: [packages/db/src/errors.ts:746](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L746) +Defined in: [packages/db/src/errors.ts:751](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L751) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:746](https://github.com/TanStack/db/blob/ new FnSelectWithGroupByError(): FnSelectWithGroupByError; ``` -Defined in: [packages/db/src/errors.ts:747](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L747) +Defined in: [packages/db/src/errors.ts:752](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L752) #### Returns diff --git a/docs/reference/classes/GroupByError.md b/docs/reference/classes/GroupByError.md index eb74ae10b1..9518009b8e 100644 --- a/docs/reference/classes/GroupByError.md +++ b/docs/reference/classes/GroupByError.md @@ -3,7 +3,7 @@ id: GroupByError title: GroupByError --- -Defined in: [packages/db/src/errors.ts:990](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L990) +Defined in: [packages/db/src/errors.ts:976](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L976) ## Extends @@ -24,7 +24,7 @@ Defined in: [packages/db/src/errors.ts:990](https://github.com/TanStack/db/blob/ new GroupByError(message): GroupByError; ``` -Defined in: [packages/db/src/errors.ts:991](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L991) +Defined in: [packages/db/src/errors.ts:977](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L977) #### Parameters diff --git a/docs/reference/classes/GroupingOperatorRequiredError.md b/docs/reference/classes/GroupingOperatorRequiredError.md index 8d9becbc5a..9d02c72346 100644 --- a/docs/reference/classes/GroupingOperatorRequiredError.md +++ b/docs/reference/classes/GroupingOperatorRequiredError.md @@ -3,7 +3,7 @@ id: GroupingOperatorRequiredError title: GroupingOperatorRequiredError --- -Defined in: [packages/db/src/errors.ts:759](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L759) +Defined in: [packages/db/src/errors.ts:764](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L764) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:759](https://github.com/TanStack/db/blob/ new GroupingOperatorRequiredError(): GroupingOperatorRequiredError; ``` -Defined in: [packages/db/src/errors.ts:760](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L760) +Defined in: [packages/db/src/errors.ts:765](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L765) #### Returns diff --git a/docs/reference/classes/HavingRequiresGroupByError.md b/docs/reference/classes/HavingRequiresGroupByError.md index d2de667542..8a288a0ec2 100644 --- a/docs/reference/classes/HavingRequiresGroupByError.md +++ b/docs/reference/classes/HavingRequiresGroupByError.md @@ -3,7 +3,7 @@ id: HavingRequiresGroupByError title: HavingRequiresGroupByError --- -Defined in: [packages/db/src/errors.ts:792](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L792) +Defined in: [packages/db/src/errors.ts:797](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L797) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:792](https://github.com/TanStack/db/blob/ new HavingRequiresGroupByError(): HavingRequiresGroupByError; ``` -Defined in: [packages/db/src/errors.ts:793](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L793) +Defined in: [packages/db/src/errors.ts:798](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L798) #### Returns diff --git a/docs/reference/classes/IncludeOperatorRequiredError.md b/docs/reference/classes/IncludeOperatorRequiredError.md index ba652c4ae0..558d267afd 100644 --- a/docs/reference/classes/IncludeOperatorRequiredError.md +++ b/docs/reference/classes/IncludeOperatorRequiredError.md @@ -3,7 +3,7 @@ id: IncludeOperatorRequiredError title: IncludeOperatorRequiredError --- -Defined in: [packages/db/src/errors.ts:643](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L643) +Defined in: [packages/db/src/errors.ts:648](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L648) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:643](https://github.com/TanStack/db/blob/ new IncludeOperatorRequiredError(field): IncludeOperatorRequiredError; ``` -Defined in: [packages/db/src/errors.ts:644](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L644) +Defined in: [packages/db/src/errors.ts:649](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L649) #### Parameters diff --git a/docs/reference/classes/InvalidJoinCondition.md b/docs/reference/classes/InvalidJoinCondition.md index 2214ae4641..27806d9617 100644 --- a/docs/reference/classes/InvalidJoinCondition.md +++ b/docs/reference/classes/InvalidJoinCondition.md @@ -3,7 +3,7 @@ id: InvalidJoinCondition title: InvalidJoinCondition --- -Defined in: [packages/db/src/errors.ts:969](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L969) +Defined in: [packages/db/src/errors.ts:955](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L955) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:969](https://github.com/TanStack/db/blob/ new InvalidJoinCondition(): InvalidJoinCondition; ``` -Defined in: [packages/db/src/errors.ts:970](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L970) +Defined in: [packages/db/src/errors.ts:956](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L956) #### Returns diff --git a/docs/reference/classes/InvalidJoinConditionLeftSourceError.md b/docs/reference/classes/InvalidJoinConditionLeftSourceError.md index 4170599b92..9e3d13970a 100644 --- a/docs/reference/classes/InvalidJoinConditionLeftSourceError.md +++ b/docs/reference/classes/InvalidJoinConditionLeftSourceError.md @@ -3,7 +3,7 @@ id: InvalidJoinConditionLeftSourceError title: InvalidJoinConditionLeftSourceError --- -Defined in: [packages/db/src/errors.ts:949](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L949) +Defined in: [packages/db/src/errors.ts:935](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L935) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:949](https://github.com/TanStack/db/blob/ new InvalidJoinConditionLeftSourceError(sourceAlias): InvalidJoinConditionLeftSourceError; ``` -Defined in: [packages/db/src/errors.ts:950](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L950) +Defined in: [packages/db/src/errors.ts:936](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L936) #### Parameters diff --git a/docs/reference/classes/InvalidJoinConditionRightSourceError.md b/docs/reference/classes/InvalidJoinConditionRightSourceError.md index bba35933df..81cb5e7edc 100644 --- a/docs/reference/classes/InvalidJoinConditionRightSourceError.md +++ b/docs/reference/classes/InvalidJoinConditionRightSourceError.md @@ -3,7 +3,7 @@ id: InvalidJoinConditionRightSourceError title: InvalidJoinConditionRightSourceError --- -Defined in: [packages/db/src/errors.ts:959](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L959) +Defined in: [packages/db/src/errors.ts:945](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L945) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:959](https://github.com/TanStack/db/blob/ new InvalidJoinConditionRightSourceError(sourceAlias): InvalidJoinConditionRightSourceError; ``` -Defined in: [packages/db/src/errors.ts:960](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L960) +Defined in: [packages/db/src/errors.ts:946](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L946) #### Parameters diff --git a/docs/reference/classes/InvalidJoinConditionSameSourceError.md b/docs/reference/classes/InvalidJoinConditionSameSourceError.md index e68b0cba22..cd9c463438 100644 --- a/docs/reference/classes/InvalidJoinConditionSameSourceError.md +++ b/docs/reference/classes/InvalidJoinConditionSameSourceError.md @@ -3,7 +3,7 @@ id: InvalidJoinConditionSameSourceError title: InvalidJoinConditionSameSourceError --- -Defined in: [packages/db/src/errors.ts:929](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L929) +Defined in: [packages/db/src/errors.ts:915](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L915) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:929](https://github.com/TanStack/db/blob/ new InvalidJoinConditionSameSourceError(sourceAlias): InvalidJoinConditionSameSourceError; ``` -Defined in: [packages/db/src/errors.ts:930](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L930) +Defined in: [packages/db/src/errors.ts:916](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L916) #### Parameters diff --git a/docs/reference/classes/InvalidJoinConditionSourceMismatchError.md b/docs/reference/classes/InvalidJoinConditionSourceMismatchError.md index 1aa8152a13..51bcd0eed2 100644 --- a/docs/reference/classes/InvalidJoinConditionSourceMismatchError.md +++ b/docs/reference/classes/InvalidJoinConditionSourceMismatchError.md @@ -3,7 +3,7 @@ id: InvalidJoinConditionSourceMismatchError title: InvalidJoinConditionSourceMismatchError --- -Defined in: [packages/db/src/errors.ts:939](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L939) +Defined in: [packages/db/src/errors.ts:925](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L925) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:939](https://github.com/TanStack/db/blob/ new InvalidJoinConditionSourceMismatchError(): InvalidJoinConditionSourceMismatchError; ``` -Defined in: [packages/db/src/errors.ts:940](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L940) +Defined in: [packages/db/src/errors.ts:926](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L926) #### Returns diff --git a/docs/reference/classes/InvalidKeyError.md b/docs/reference/classes/InvalidKeyError.md index d139ea9b39..004a6698d2 100644 --- a/docs/reference/classes/InvalidKeyError.md +++ b/docs/reference/classes/InvalidKeyError.md @@ -3,7 +3,7 @@ id: InvalidKeyError title: InvalidKeyError --- -Defined in: [packages/db/src/errors.ts:250](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L250) +Defined in: [packages/db/src/errors.ts:255](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L255) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:250](https://github.com/TanStack/db/blob/ new InvalidKeyError(key, item): InvalidKeyError; ``` -Defined in: [packages/db/src/errors.ts:251](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L251) +Defined in: [packages/db/src/errors.ts:256](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L256) #### Parameters diff --git a/docs/reference/classes/InvalidPoolOptionError.md b/docs/reference/classes/InvalidPoolOptionError.md index e2c79759aa..46f1793a85 100644 --- a/docs/reference/classes/InvalidPoolOptionError.md +++ b/docs/reference/classes/InvalidPoolOptionError.md @@ -3,7 +3,7 @@ id: InvalidPoolOptionError title: InvalidPoolOptionError --- -Defined in: [packages/db/src/errors.ts:1248](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1248) +Defined in: [packages/db/src/errors.ts:1234](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1234) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1248](https://github.com/TanStack/db/blob new InvalidPoolOptionError(): InvalidPoolOptionError; ``` -Defined in: [packages/db/src/errors.ts:1249](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1249) +Defined in: [packages/db/src/errors.ts:1235](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1235) #### Returns diff --git a/docs/reference/classes/InvalidSourceError.md b/docs/reference/classes/InvalidSourceError.md index 1384b71e5c..ae5d586f99 100644 --- a/docs/reference/classes/InvalidSourceError.md +++ b/docs/reference/classes/InvalidSourceError.md @@ -3,7 +3,7 @@ id: InvalidSourceError title: InvalidSourceError --- -Defined in: [packages/db/src/errors.ts:633](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L633) +Defined in: [packages/db/src/errors.ts:638](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L638) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:633](https://github.com/TanStack/db/blob/ new InvalidSourceError(alias): InvalidSourceError; ``` -Defined in: [packages/db/src/errors.ts:634](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L634) +Defined in: [packages/db/src/errors.ts:639](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L639) #### Parameters diff --git a/docs/reference/classes/InvalidSourceTypeError.md b/docs/reference/classes/InvalidSourceTypeError.md index c7d7f3ddd3..f8e7e47550 100644 --- a/docs/reference/classes/InvalidSourceTypeError.md +++ b/docs/reference/classes/InvalidSourceTypeError.md @@ -3,7 +3,7 @@ id: InvalidSourceTypeError title: InvalidSourceTypeError --- -Defined in: [packages/db/src/errors.ts:656](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L656) +Defined in: [packages/db/src/errors.ts:661](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L661) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:656](https://github.com/TanStack/db/blob/ new InvalidSourceTypeError(context, type): InvalidSourceTypeError; ``` -Defined in: [packages/db/src/errors.ts:657](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L657) +Defined in: [packages/db/src/errors.ts:662](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L662) #### Parameters diff --git a/docs/reference/classes/InvalidStorageDataFormatError.md b/docs/reference/classes/InvalidStorageDataFormatError.md index 7b6615af44..3c62fc19e9 100644 --- a/docs/reference/classes/InvalidStorageDataFormatError.md +++ b/docs/reference/classes/InvalidStorageDataFormatError.md @@ -3,7 +3,7 @@ id: InvalidStorageDataFormatError title: InvalidStorageDataFormatError --- -Defined in: [packages/db/src/errors.ts:1073](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1073) +Defined in: [packages/db/src/errors.ts:1059](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1059) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1073](https://github.com/TanStack/db/blob new InvalidStorageDataFormatError(storageKey, key): InvalidStorageDataFormatError; ``` -Defined in: [packages/db/src/errors.ts:1074](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1074) +Defined in: [packages/db/src/errors.ts:1060](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1060) #### Parameters diff --git a/docs/reference/classes/InvalidStorageObjectFormatError.md b/docs/reference/classes/InvalidStorageObjectFormatError.md index dc027635f7..a7161e2627 100644 --- a/docs/reference/classes/InvalidStorageObjectFormatError.md +++ b/docs/reference/classes/InvalidStorageObjectFormatError.md @@ -3,7 +3,7 @@ id: InvalidStorageObjectFormatError title: InvalidStorageObjectFormatError --- -Defined in: [packages/db/src/errors.ts:1083](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1083) +Defined in: [packages/db/src/errors.ts:1069](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1069) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1083](https://github.com/TanStack/db/blob new InvalidStorageObjectFormatError(storageKey): InvalidStorageObjectFormatError; ``` -Defined in: [packages/db/src/errors.ts:1084](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1084) +Defined in: [packages/db/src/errors.ts:1070](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1070) #### Parameters diff --git a/docs/reference/classes/InvalidWhereExpressionError.md b/docs/reference/classes/InvalidWhereExpressionError.md index ba870122e5..87a383e7a2 100644 --- a/docs/reference/classes/InvalidWhereExpressionError.md +++ b/docs/reference/classes/InvalidWhereExpressionError.md @@ -3,7 +3,7 @@ id: InvalidWhereExpressionError title: InvalidWhereExpressionError --- -Defined in: [packages/db/src/errors.ts:701](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L701) +Defined in: [packages/db/src/errors.ts:706](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L706) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:701](https://github.com/TanStack/db/blob/ new InvalidWhereExpressionError(valueType): InvalidWhereExpressionError; ``` -Defined in: [packages/db/src/errors.ts:702](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L702) +Defined in: [packages/db/src/errors.ts:707](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L707) #### Parameters diff --git a/docs/reference/classes/JoinCollectionNotFoundError.md b/docs/reference/classes/JoinCollectionNotFoundError.md index 35e3487061..11e17419b3 100644 --- a/docs/reference/classes/JoinCollectionNotFoundError.md +++ b/docs/reference/classes/JoinCollectionNotFoundError.md @@ -3,7 +3,7 @@ id: JoinCollectionNotFoundError title: JoinCollectionNotFoundError --- -Defined in: [packages/db/src/errors.ts:901](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L901) +Defined in: [packages/db/src/errors.ts:887](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L887) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:901](https://github.com/TanStack/db/blob/ new JoinCollectionNotFoundError(collectionId): JoinCollectionNotFoundError; ``` -Defined in: [packages/db/src/errors.ts:902](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L902) +Defined in: [packages/db/src/errors.ts:888](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L888) #### Parameters diff --git a/docs/reference/classes/JoinConditionMustBeEqualityError.md b/docs/reference/classes/JoinConditionMustBeEqualityError.md index a31d2b76bc..4095db1aa7 100644 --- a/docs/reference/classes/JoinConditionMustBeEqualityError.md +++ b/docs/reference/classes/JoinConditionMustBeEqualityError.md @@ -3,7 +3,7 @@ id: JoinConditionMustBeEqualityError title: JoinConditionMustBeEqualityError --- -Defined in: [packages/db/src/errors.ts:681](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L681) +Defined in: [packages/db/src/errors.ts:686](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L686) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:681](https://github.com/TanStack/db/blob/ new JoinConditionMustBeEqualityError(): JoinConditionMustBeEqualityError; ``` -Defined in: [packages/db/src/errors.ts:682](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L682) +Defined in: [packages/db/src/errors.ts:687](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L687) #### Returns diff --git a/docs/reference/classes/JoinError.md b/docs/reference/classes/JoinError.md index 18d0e67d7f..d50a65a079 100644 --- a/docs/reference/classes/JoinError.md +++ b/docs/reference/classes/JoinError.md @@ -3,7 +3,7 @@ id: JoinError title: JoinError --- -Defined in: [packages/db/src/errors.ts:912](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L912) +Defined in: [packages/db/src/errors.ts:898](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L898) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/db/src/errors.ts:912](https://github.com/TanStack/db/blob/ new JoinError(message): JoinError; ``` -Defined in: [packages/db/src/errors.ts:913](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L913) +Defined in: [packages/db/src/errors.ts:899](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L899) #### Parameters diff --git a/docs/reference/classes/KeyUpdateNotAllowedError.md b/docs/reference/classes/KeyUpdateNotAllowedError.md index e6c6024bd0..95b4ebcb16 100644 --- a/docs/reference/classes/KeyUpdateNotAllowedError.md +++ b/docs/reference/classes/KeyUpdateNotAllowedError.md @@ -3,7 +3,7 @@ id: KeyUpdateNotAllowedError title: KeyUpdateNotAllowedError --- -Defined in: [packages/db/src/errors.ts:346](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L346) +Defined in: [packages/db/src/errors.ts:351](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L351) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:346](https://github.com/TanStack/db/blob/ new KeyUpdateNotAllowedError(originalKey, newKey): KeyUpdateNotAllowedError; ``` -Defined in: [packages/db/src/errors.ts:347](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L347) +Defined in: [packages/db/src/errors.ts:352](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L352) #### Parameters diff --git a/docs/reference/classes/LimitOffsetRequireOrderByError.md b/docs/reference/classes/LimitOffsetRequireOrderByError.md index be7c50e106..562973edcd 100644 --- a/docs/reference/classes/LimitOffsetRequireOrderByError.md +++ b/docs/reference/classes/LimitOffsetRequireOrderByError.md @@ -3,7 +3,7 @@ id: LimitOffsetRequireOrderByError title: LimitOffsetRequireOrderByError --- -Defined in: [packages/db/src/errors.ts:802](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L802) +Defined in: [packages/db/src/errors.ts:807](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L807) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:802](https://github.com/TanStack/db/blob/ new LimitOffsetRequireOrderByError(): LimitOffsetRequireOrderByError; ``` -Defined in: [packages/db/src/errors.ts:803](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L803) +Defined in: [packages/db/src/errors.ts:808](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L808) #### Returns diff --git a/docs/reference/classes/LoadSubsetOperationAbortedError.md b/docs/reference/classes/LoadSubsetOperationAbortedError.md index 9bc7078225..1699960ba8 100644 --- a/docs/reference/classes/LoadSubsetOperationAbortedError.md +++ b/docs/reference/classes/LoadSubsetOperationAbortedError.md @@ -3,7 +3,7 @@ id: LoadSubsetOperationAbortedError title: LoadSubsetOperationAbortedError --- -Defined in: [packages/db/src/errors.ts:1130](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1130) +Defined in: [packages/db/src/errors.ts:1116](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1116) A subset operation was canceled before its result became visible. @@ -19,7 +19,7 @@ A subset operation was canceled before its result became visible. new LoadSubsetOperationAbortedError(): LoadSubsetOperationAbortedError; ``` -Defined in: [packages/db/src/errors.ts:1131](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1131) +Defined in: [packages/db/src/errors.ts:1117](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1117) #### Returns diff --git a/docs/reference/classes/LocalStorageCollectionError.md b/docs/reference/classes/LocalStorageCollectionError.md index 999bb7751d..da9177d3f3 100644 --- a/docs/reference/classes/LocalStorageCollectionError.md +++ b/docs/reference/classes/LocalStorageCollectionError.md @@ -3,7 +3,7 @@ id: LocalStorageCollectionError title: LocalStorageCollectionError --- -Defined in: [packages/db/src/errors.ts:1056](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1056) +Defined in: [packages/db/src/errors.ts:1042](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1042) ## Extends @@ -23,7 +23,7 @@ Defined in: [packages/db/src/errors.ts:1056](https://github.com/TanStack/db/blob new LocalStorageCollectionError(message): LocalStorageCollectionError; ``` -Defined in: [packages/db/src/errors.ts:1057](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1057) +Defined in: [packages/db/src/errors.ts:1043](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1043) #### Parameters diff --git a/docs/reference/classes/MissingAliasInputsError.md b/docs/reference/classes/MissingAliasInputsError.md index 88318cecf4..0b4a01d1df 100644 --- a/docs/reference/classes/MissingAliasInputsError.md +++ b/docs/reference/classes/MissingAliasInputsError.md @@ -3,7 +3,7 @@ id: MissingAliasInputsError title: MissingAliasInputsError --- -Defined in: [packages/db/src/errors.ts:1163](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1163) +Defined in: [packages/db/src/errors.ts:1149](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1149) Internal error when the compiler returns aliases that don't have corresponding input streams. This should never happen since all aliases come from user declarations. @@ -20,7 +20,7 @@ This should never happen since all aliases come from user declarations. new MissingAliasInputsError(missingAliases): MissingAliasInputsError; ``` -Defined in: [packages/db/src/errors.ts:1164](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1164) +Defined in: [packages/db/src/errors.ts:1150](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1150) #### Parameters diff --git a/docs/reference/classes/MissingDeleteHandlerError.md b/docs/reference/classes/MissingDeleteHandlerError.md index 11e88b1cf7..2eaa3e7036 100644 --- a/docs/reference/classes/MissingDeleteHandlerError.md +++ b/docs/reference/classes/MissingDeleteHandlerError.md @@ -3,7 +3,7 @@ id: MissingDeleteHandlerError title: MissingDeleteHandlerError --- -Defined in: [packages/db/src/errors.ts:404](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L404) +Defined in: [packages/db/src/errors.ts:409](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L409) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:404](https://github.com/TanStack/db/blob/ new MissingDeleteHandlerError(): MissingDeleteHandlerError; ``` -Defined in: [packages/db/src/errors.ts:405](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L405) +Defined in: [packages/db/src/errors.ts:410](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L410) #### Returns diff --git a/docs/reference/classes/MissingHandlerError.md b/docs/reference/classes/MissingHandlerError.md index 739e2830df..029abc464a 100644 --- a/docs/reference/classes/MissingHandlerError.md +++ b/docs/reference/classes/MissingHandlerError.md @@ -3,7 +3,7 @@ id: MissingHandlerError title: MissingHandlerError --- -Defined in: [packages/db/src/errors.ts:377](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L377) +Defined in: [packages/db/src/errors.ts:382](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L382) ## Extends @@ -23,7 +23,7 @@ Defined in: [packages/db/src/errors.ts:377](https://github.com/TanStack/db/blob/ new MissingHandlerError(message): MissingHandlerError; ``` -Defined in: [packages/db/src/errors.ts:378](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L378) +Defined in: [packages/db/src/errors.ts:383](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L383) #### Parameters diff --git a/docs/reference/classes/MissingInsertHandlerError.md b/docs/reference/classes/MissingInsertHandlerError.md index 8ab5c3e66e..4c7130b42d 100644 --- a/docs/reference/classes/MissingInsertHandlerError.md +++ b/docs/reference/classes/MissingInsertHandlerError.md @@ -3,7 +3,7 @@ id: MissingInsertHandlerError title: MissingInsertHandlerError --- -Defined in: [packages/db/src/errors.ts:384](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L384) +Defined in: [packages/db/src/errors.ts:389](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L389) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:384](https://github.com/TanStack/db/blob/ new MissingInsertHandlerError(): MissingInsertHandlerError; ``` -Defined in: [packages/db/src/errors.ts:385](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L385) +Defined in: [packages/db/src/errors.ts:390](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L390) #### Returns diff --git a/docs/reference/classes/MissingMutationFunctionError.md b/docs/reference/classes/MissingMutationFunctionError.md index 5bb19da94b..9be614802c 100644 --- a/docs/reference/classes/MissingMutationFunctionError.md +++ b/docs/reference/classes/MissingMutationFunctionError.md @@ -3,7 +3,7 @@ id: MissingMutationFunctionError title: MissingMutationFunctionError --- -Defined in: [packages/db/src/errors.ts:477](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L477) +Defined in: [packages/db/src/errors.ts:482](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L482) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:477](https://github.com/TanStack/db/blob/ new MissingMutationFunctionError(): MissingMutationFunctionError; ``` -Defined in: [packages/db/src/errors.ts:478](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L478) +Defined in: [packages/db/src/errors.ts:483](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L483) #### Returns diff --git a/docs/reference/classes/MissingUpdateArgumentError.md b/docs/reference/classes/MissingUpdateArgumentError.md index 56a4a85483..2e568ad99b 100644 --- a/docs/reference/classes/MissingUpdateArgumentError.md +++ b/docs/reference/classes/MissingUpdateArgumentError.md @@ -3,7 +3,7 @@ id: MissingUpdateArgumentError title: MissingUpdateArgumentError --- -Defined in: [packages/db/src/errors.ts:316](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L316) +Defined in: [packages/db/src/errors.ts:321](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L321) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:316](https://github.com/TanStack/db/blob/ new MissingUpdateArgumentError(): MissingUpdateArgumentError; ``` -Defined in: [packages/db/src/errors.ts:317](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L317) +Defined in: [packages/db/src/errors.ts:322](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L322) #### Returns diff --git a/docs/reference/classes/MissingUpdateHandlerError.md b/docs/reference/classes/MissingUpdateHandlerError.md index a9aa9b29d6..88d9fc5a03 100644 --- a/docs/reference/classes/MissingUpdateHandlerError.md +++ b/docs/reference/classes/MissingUpdateHandlerError.md @@ -3,7 +3,7 @@ id: MissingUpdateHandlerError title: MissingUpdateHandlerError --- -Defined in: [packages/db/src/errors.ts:394](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L394) +Defined in: [packages/db/src/errors.ts:399](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L399) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:394](https://github.com/TanStack/db/blob/ new MissingUpdateHandlerError(): MissingUpdateHandlerError; ``` -Defined in: [packages/db/src/errors.ts:395](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L395) +Defined in: [packages/db/src/errors.ts:400](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L400) #### Returns diff --git a/docs/reference/classes/NoKeysPassedToDeleteError.md b/docs/reference/classes/NoKeysPassedToDeleteError.md index a53d014b6f..3809c07eba 100644 --- a/docs/reference/classes/NoKeysPassedToDeleteError.md +++ b/docs/reference/classes/NoKeysPassedToDeleteError.md @@ -3,7 +3,7 @@ id: NoKeysPassedToDeleteError title: NoKeysPassedToDeleteError --- -Defined in: [packages/db/src/errors.ts:356](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L356) +Defined in: [packages/db/src/errors.ts:361](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L361) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:356](https://github.com/TanStack/db/blob/ new NoKeysPassedToDeleteError(): NoKeysPassedToDeleteError; ``` -Defined in: [packages/db/src/errors.ts:357](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L357) +Defined in: [packages/db/src/errors.ts:362](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L362) #### Returns diff --git a/docs/reference/classes/NoKeysPassedToUpdateError.md b/docs/reference/classes/NoKeysPassedToUpdateError.md index f9df0fe548..c0c85efa57 100644 --- a/docs/reference/classes/NoKeysPassedToUpdateError.md +++ b/docs/reference/classes/NoKeysPassedToUpdateError.md @@ -3,7 +3,7 @@ id: NoKeysPassedToUpdateError title: NoKeysPassedToUpdateError --- -Defined in: [packages/db/src/errors.ts:326](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L326) +Defined in: [packages/db/src/errors.ts:331](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L331) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:326](https://github.com/TanStack/db/blob/ new NoKeysPassedToUpdateError(): NoKeysPassedToUpdateError; ``` -Defined in: [packages/db/src/errors.ts:327](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L327) +Defined in: [packages/db/src/errors.ts:332](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L332) #### Returns diff --git a/docs/reference/classes/NoPendingSyncTransactionCommitError.md b/docs/reference/classes/NoPendingSyncTransactionCommitError.md index 1f1c78e1ba..0315a019b7 100644 --- a/docs/reference/classes/NoPendingSyncTransactionCommitError.md +++ b/docs/reference/classes/NoPendingSyncTransactionCommitError.md @@ -3,7 +3,7 @@ id: NoPendingSyncTransactionCommitError title: NoPendingSyncTransactionCommitError --- -Defined in: [packages/db/src/errors.ts:570](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L570) +Defined in: [packages/db/src/errors.ts:575](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L575) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:570](https://github.com/TanStack/db/blob/ new NoPendingSyncTransactionCommitError(): NoPendingSyncTransactionCommitError; ``` -Defined in: [packages/db/src/errors.ts:571](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L571) +Defined in: [packages/db/src/errors.ts:576](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L576) #### Returns diff --git a/docs/reference/classes/NoPendingSyncTransactionWriteError.md b/docs/reference/classes/NoPendingSyncTransactionWriteError.md index 4aba78d567..428922bb67 100644 --- a/docs/reference/classes/NoPendingSyncTransactionWriteError.md +++ b/docs/reference/classes/NoPendingSyncTransactionWriteError.md @@ -3,7 +3,7 @@ id: NoPendingSyncTransactionWriteError title: NoPendingSyncTransactionWriteError --- -Defined in: [packages/db/src/errors.ts:538](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L538) +Defined in: [packages/db/src/errors.ts:543](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L543) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:538](https://github.com/TanStack/db/blob/ new NoPendingSyncTransactionWriteError(): NoPendingSyncTransactionWriteError; ``` -Defined in: [packages/db/src/errors.ts:539](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L539) +Defined in: [packages/db/src/errors.ts:544](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L544) #### Returns diff --git a/docs/reference/classes/NonAggregateExpressionNotInGroupByError.md b/docs/reference/classes/NonAggregateExpressionNotInGroupByError.md index 1b1b38e655..e52156f3cb 100644 --- a/docs/reference/classes/NonAggregateExpressionNotInGroupByError.md +++ b/docs/reference/classes/NonAggregateExpressionNotInGroupByError.md @@ -3,7 +3,7 @@ id: NonAggregateExpressionNotInGroupByError title: NonAggregateExpressionNotInGroupByError --- -Defined in: [packages/db/src/errors.ts:997](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L997) +Defined in: [packages/db/src/errors.ts:983](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L983) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:997](https://github.com/TanStack/db/blob/ new NonAggregateExpressionNotInGroupByError(alias): NonAggregateExpressionNotInGroupByError; ``` -Defined in: [packages/db/src/errors.ts:998](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L998) +Defined in: [packages/db/src/errors.ts:984](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L984) #### Parameters diff --git a/docs/reference/classes/OnMutateMustBeSynchronousError.md b/docs/reference/classes/OnMutateMustBeSynchronousError.md index a00eff403d..426962b139 100644 --- a/docs/reference/classes/OnMutateMustBeSynchronousError.md +++ b/docs/reference/classes/OnMutateMustBeSynchronousError.md @@ -3,7 +3,7 @@ id: OnMutateMustBeSynchronousError title: OnMutateMustBeSynchronousError --- -Defined in: [packages/db/src/errors.ts:487](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L487) +Defined in: [packages/db/src/errors.ts:492](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L492) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:487](https://github.com/TanStack/db/blob/ new OnMutateMustBeSynchronousError(): OnMutateMustBeSynchronousError; ``` -Defined in: [packages/db/src/errors.ts:488](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L488) +Defined in: [packages/db/src/errors.ts:493](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L493) #### Returns diff --git a/docs/reference/classes/OnlyOneSourceAllowedError.md b/docs/reference/classes/OnlyOneSourceAllowedError.md index 9844eb2d8f..0360fb1b65 100644 --- a/docs/reference/classes/OnlyOneSourceAllowedError.md +++ b/docs/reference/classes/OnlyOneSourceAllowedError.md @@ -3,7 +3,7 @@ id: OnlyOneSourceAllowedError title: OnlyOneSourceAllowedError --- -Defined in: [packages/db/src/errors.ts:613](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L613) +Defined in: [packages/db/src/errors.ts:618](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L618) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:613](https://github.com/TanStack/db/blob/ new OnlyOneSourceAllowedError(context): OnlyOneSourceAllowedError; ``` -Defined in: [packages/db/src/errors.ts:614](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L614) +Defined in: [packages/db/src/errors.ts:619](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L619) #### Parameters diff --git a/docs/reference/classes/PacedTransactionManualCommitError.md b/docs/reference/classes/PacedTransactionManualCommitError.md index 371ccc8c6a..330804eff1 100644 --- a/docs/reference/classes/PacedTransactionManualCommitError.md +++ b/docs/reference/classes/PacedTransactionManualCommitError.md @@ -3,7 +3,7 @@ id: PacedTransactionManualCommitError title: PacedTransactionManualCommitError --- -Defined in: [packages/db/src/errors.ts:422](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L422) +Defined in: [packages/db/src/errors.ts:427](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L427) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:422](https://github.com/TanStack/db/blob/ new PacedTransactionManualCommitError(): PacedTransactionManualCommitError; ``` -Defined in: [packages/db/src/errors.ts:423](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L423) +Defined in: [packages/db/src/errors.ts:428](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L428) #### Returns diff --git a/docs/reference/classes/QueryBuilderError.md b/docs/reference/classes/QueryBuilderError.md index 856adeb4ff..c3d537bd3f 100644 --- a/docs/reference/classes/QueryBuilderError.md +++ b/docs/reference/classes/QueryBuilderError.md @@ -3,7 +3,7 @@ id: QueryBuilderError title: QueryBuilderError --- -Defined in: [packages/db/src/errors.ts:606](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L606) +Defined in: [packages/db/src/errors.ts:611](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L611) ## Extends @@ -28,7 +28,7 @@ Defined in: [packages/db/src/errors.ts:606](https://github.com/TanStack/db/blob/ new QueryBuilderError(message): QueryBuilderError; ``` -Defined in: [packages/db/src/errors.ts:607](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L607) +Defined in: [packages/db/src/errors.ts:612](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L612) #### Parameters diff --git a/docs/reference/classes/QueryCompilationError.md b/docs/reference/classes/QueryCompilationError.md index 051d3edf51..5f5cda5f44 100644 --- a/docs/reference/classes/QueryCompilationError.md +++ b/docs/reference/classes/QueryCompilationError.md @@ -3,7 +3,7 @@ id: QueryCompilationError title: QueryCompilationError --- -Defined in: [packages/db/src/errors.ts:717](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L717) +Defined in: [packages/db/src/errors.ts:722](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L722) ## Extends @@ -20,7 +20,6 @@ Defined in: [packages/db/src/errors.ts:717](https://github.com/TanStack/db/blob/ - [`HavingRequiresGroupByError`](HavingRequiresGroupByError.md) - [`LimitOffsetRequireOrderByError`](LimitOffsetRequireOrderByError.md) - [`CollectionInputNotFoundError`](CollectionInputNotFoundError.md) -- [`DuplicateAliasInSubqueryError`](DuplicateAliasInSubqueryError.md) - [`UnsupportedFromTypeError`](UnsupportedFromTypeError.md) - [`UnknownExpressionTypeError`](UnknownExpressionTypeError.md) - [`EmptyReferencePathError`](EmptyReferencePathError.md) @@ -38,7 +37,7 @@ Defined in: [packages/db/src/errors.ts:717](https://github.com/TanStack/db/blob/ new QueryCompilationError(message): QueryCompilationError; ``` -Defined in: [packages/db/src/errors.ts:718](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L718) +Defined in: [packages/db/src/errors.ts:723](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L723) #### Parameters diff --git a/docs/reference/classes/QueryMustHaveFromClauseError.md b/docs/reference/classes/QueryMustHaveFromClauseError.md index facf24d7a5..2f1d516c8b 100644 --- a/docs/reference/classes/QueryMustHaveFromClauseError.md +++ b/docs/reference/classes/QueryMustHaveFromClauseError.md @@ -3,7 +3,7 @@ id: QueryMustHaveFromClauseError title: QueryMustHaveFromClauseError --- -Defined in: [packages/db/src/errors.ts:691](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L691) +Defined in: [packages/db/src/errors.ts:696](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L696) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:691](https://github.com/TanStack/db/blob/ new QueryMustHaveFromClauseError(): QueryMustHaveFromClauseError; ``` -Defined in: [packages/db/src/errors.ts:692](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L692) +Defined in: [packages/db/src/errors.ts:697](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L697) #### Returns diff --git a/docs/reference/classes/QueryOptimizerError.md b/docs/reference/classes/QueryOptimizerError.md index 9c9374e4e4..87d7e709cc 100644 --- a/docs/reference/classes/QueryOptimizerError.md +++ b/docs/reference/classes/QueryOptimizerError.md @@ -3,7 +3,7 @@ id: QueryOptimizerError title: QueryOptimizerError --- -Defined in: [packages/db/src/errors.ts:1142](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1142) +Defined in: [packages/db/src/errors.ts:1128](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1128) ## Extends @@ -21,7 +21,7 @@ Defined in: [packages/db/src/errors.ts:1142](https://github.com/TanStack/db/blob new QueryOptimizerError(message): QueryOptimizerError; ``` -Defined in: [packages/db/src/errors.ts:1143](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1143) +Defined in: [packages/db/src/errors.ts:1129](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1129) #### Parameters diff --git a/docs/reference/classes/QueueCapacityExceededError.md b/docs/reference/classes/QueueCapacityExceededError.md index b761acfae9..f5697343ca 100644 --- a/docs/reference/classes/QueueCapacityExceededError.md +++ b/docs/reference/classes/QueueCapacityExceededError.md @@ -3,7 +3,7 @@ id: QueueCapacityExceededError title: QueueCapacityExceededError --- -Defined in: [packages/db/src/errors.ts:433](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L433) +Defined in: [packages/db/src/errors.ts:438](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L438) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:433](https://github.com/TanStack/db/blob/ new QueueCapacityExceededError(): QueueCapacityExceededError; ``` -Defined in: [packages/db/src/errors.ts:434](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L434) +Defined in: [packages/db/src/errors.ts:439](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L439) #### Returns diff --git a/docs/reference/classes/QueueDisposedError.md b/docs/reference/classes/QueueDisposedError.md index 9a4141d912..1541280de4 100644 --- a/docs/reference/classes/QueueDisposedError.md +++ b/docs/reference/classes/QueueDisposedError.md @@ -3,7 +3,7 @@ id: QueueDisposedError title: QueueDisposedError --- -Defined in: [packages/db/src/errors.ts:444](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L444) +Defined in: [packages/db/src/errors.ts:449](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L449) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:444](https://github.com/TanStack/db/blob/ new QueueDisposedError(): QueueDisposedError; ``` -Defined in: [packages/db/src/errors.ts:445](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L445) +Defined in: [packages/db/src/errors.ts:450](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L450) #### Returns diff --git a/docs/reference/classes/SerializationError.md b/docs/reference/classes/SerializationError.md index 9dcaa46852..6ecbb35e16 100644 --- a/docs/reference/classes/SerializationError.md +++ b/docs/reference/classes/SerializationError.md @@ -3,7 +3,7 @@ id: SerializationError title: SerializationError --- -Defined in: [packages/db/src/errors.ts:1045](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1045) +Defined in: [packages/db/src/errors.ts:1031](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1031) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1045](https://github.com/TanStack/db/blob new SerializationError(operation, originalError): SerializationError; ``` -Defined in: [packages/db/src/errors.ts:1046](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1046) +Defined in: [packages/db/src/errors.ts:1032](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1032) #### Parameters diff --git a/docs/reference/classes/SetWindowFindOneLimitError.md b/docs/reference/classes/SetWindowFindOneLimitError.md index 0d0f90396c..50fd07c5bb 100644 --- a/docs/reference/classes/SetWindowFindOneLimitError.md +++ b/docs/reference/classes/SetWindowFindOneLimitError.md @@ -3,7 +3,7 @@ id: SetWindowFindOneLimitError title: SetWindowFindOneLimitError --- -Defined in: [packages/db/src/errors.ts:1191](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1191) +Defined in: [packages/db/src/errors.ts:1177](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1177) Error thrown when setWindow would change the limit of a findOne() query. @@ -19,7 +19,7 @@ Error thrown when setWindow would change the limit of a findOne() query. new SetWindowFindOneLimitError(): SetWindowFindOneLimitError; ``` -Defined in: [packages/db/src/errors.ts:1192](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1192) +Defined in: [packages/db/src/errors.ts:1178](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1178) #### Returns diff --git a/docs/reference/classes/SetWindowReentrancyError.md b/docs/reference/classes/SetWindowReentrancyError.md index 5adaf59e37..e2f025ee6a 100644 --- a/docs/reference/classes/SetWindowReentrancyError.md +++ b/docs/reference/classes/SetWindowReentrancyError.md @@ -3,7 +3,7 @@ id: SetWindowReentrancyError title: SetWindowReentrancyError --- -Defined in: [packages/db/src/errors.ts:1202](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1202) +Defined in: [packages/db/src/errors.ts:1188](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1188) Error thrown when setWindow is called from inside another setWindow call. @@ -19,7 +19,7 @@ Error thrown when setWindow is called from inside another setWindow call. new SetWindowReentrancyError(): SetWindowReentrancyError; ``` -Defined in: [packages/db/src/errors.ts:1203](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1203) +Defined in: [packages/db/src/errors.ts:1189](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1189) #### Returns diff --git a/docs/reference/classes/SetWindowRequiresOrderByError.md b/docs/reference/classes/SetWindowRequiresOrderByError.md index 831434478b..b79f09e964 100644 --- a/docs/reference/classes/SetWindowRequiresOrderByError.md +++ b/docs/reference/classes/SetWindowRequiresOrderByError.md @@ -3,7 +3,7 @@ id: SetWindowRequiresOrderByError title: SetWindowRequiresOrderByError --- -Defined in: [packages/db/src/errors.ts:1177](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1177) +Defined in: [packages/db/src/errors.ts:1163](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1163) Error thrown when setWindow is called on a collection without an ORDER BY clause. @@ -19,7 +19,7 @@ Error thrown when setWindow is called on a collection without an ORDER BY clause new SetWindowRequiresOrderByError(): SetWindowRequiresOrderByError; ``` -Defined in: [packages/db/src/errors.ts:1178](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1178) +Defined in: [packages/db/src/errors.ts:1164](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1164) #### Returns diff --git a/docs/reference/classes/SourceCollectionIdReuseError.md b/docs/reference/classes/SourceCollectionIdReuseError.md index 3bc2ca07c9..582ae6bd05 100644 --- a/docs/reference/classes/SourceCollectionIdReuseError.md +++ b/docs/reference/classes/SourceCollectionIdReuseError.md @@ -3,7 +3,7 @@ id: SourceCollectionIdReuseError title: SourceCollectionIdReuseError --- -Defined in: [packages/db/src/errors.ts:1234](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1234) +Defined in: [packages/db/src/errors.ts:1220](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1220) Error thrown when a mounted framework binding that compares query identity reads a different source Collection under a Collection ID it has already @@ -23,7 +23,7 @@ source. new SourceCollectionIdReuseError(bindingName, collectionId): SourceCollectionIdReuseError; ``` -Defined in: [packages/db/src/errors.ts:1235](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1235) +Defined in: [packages/db/src/errors.ts:1221](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1221) #### Parameters @@ -51,7 +51,7 @@ Defined in: [packages/db/src/errors.ts:1235](https://github.com/TanStack/db/blob readonly bindingName: string; ``` -Defined in: [packages/db/src/errors.ts:1236](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1236) +Defined in: [packages/db/src/errors.ts:1222](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1222) *** @@ -75,7 +75,7 @@ Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/li readonly collectionId: string; ``` -Defined in: [packages/db/src/errors.ts:1237](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1237) +Defined in: [packages/db/src/errors.ts:1223](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1223) *** diff --git a/docs/reference/classes/StorageError.md b/docs/reference/classes/StorageError.md index 4c28a93594..7b2065ba8f 100644 --- a/docs/reference/classes/StorageError.md +++ b/docs/reference/classes/StorageError.md @@ -3,7 +3,7 @@ id: StorageError title: StorageError --- -Defined in: [packages/db/src/errors.ts:1038](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1038) +Defined in: [packages/db/src/errors.ts:1024](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1024) ## Extends @@ -22,7 +22,7 @@ Defined in: [packages/db/src/errors.ts:1038](https://github.com/TanStack/db/blob new StorageError(message): StorageError; ``` -Defined in: [packages/db/src/errors.ts:1039](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1039) +Defined in: [packages/db/src/errors.ts:1025](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1025) #### Parameters diff --git a/docs/reference/classes/StorageKeyRequiredError.md b/docs/reference/classes/StorageKeyRequiredError.md index 4334577a0a..49528f5588 100644 --- a/docs/reference/classes/StorageKeyRequiredError.md +++ b/docs/reference/classes/StorageKeyRequiredError.md @@ -3,7 +3,7 @@ id: StorageKeyRequiredError title: StorageKeyRequiredError --- -Defined in: [packages/db/src/errors.ts:1063](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1063) +Defined in: [packages/db/src/errors.ts:1049](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1049) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1063](https://github.com/TanStack/db/blob new StorageKeyRequiredError(): StorageKeyRequiredError; ``` -Defined in: [packages/db/src/errors.ts:1064](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1064) +Defined in: [packages/db/src/errors.ts:1050](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1050) #### Returns diff --git a/docs/reference/classes/SubQueryMustHaveFromClauseError.md b/docs/reference/classes/SubQueryMustHaveFromClauseError.md index 1f3aa3542b..43d8c889b0 100644 --- a/docs/reference/classes/SubQueryMustHaveFromClauseError.md +++ b/docs/reference/classes/SubQueryMustHaveFromClauseError.md @@ -3,7 +3,7 @@ id: SubQueryMustHaveFromClauseError title: SubQueryMustHaveFromClauseError --- -Defined in: [packages/db/src/errors.ts:623](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L623) +Defined in: [packages/db/src/errors.ts:628](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L628) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:623](https://github.com/TanStack/db/blob/ new SubQueryMustHaveFromClauseError(context): SubQueryMustHaveFromClauseError; ``` -Defined in: [packages/db/src/errors.ts:624](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L624) +Defined in: [packages/db/src/errors.ts:629](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L629) #### Parameters diff --git a/docs/reference/classes/SyncCleanupError.md b/docs/reference/classes/SyncCleanupError.md index c57ab32ba7..34b203615b 100644 --- a/docs/reference/classes/SyncCleanupError.md +++ b/docs/reference/classes/SyncCleanupError.md @@ -3,7 +3,7 @@ id: SyncCleanupError title: SyncCleanupError --- -Defined in: [packages/db/src/errors.ts:1094](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1094) +Defined in: [packages/db/src/errors.ts:1080](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1080) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1094](https://github.com/TanStack/db/blob new SyncCleanupError(collectionId, error): SyncCleanupError; ``` -Defined in: [packages/db/src/errors.ts:1095](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1095) +Defined in: [packages/db/src/errors.ts:1081](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1081) #### Parameters diff --git a/docs/reference/classes/SyncQueueInvariantError.md b/docs/reference/classes/SyncQueueInvariantError.md index bf23403b3f..18df6f0f03 100644 --- a/docs/reference/classes/SyncQueueInvariantError.md +++ b/docs/reference/classes/SyncQueueInvariantError.md @@ -3,7 +3,7 @@ id: SyncQueueInvariantError title: SyncQueueInvariantError --- -Defined in: [packages/db/src/errors.ts:595](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L595) +Defined in: [packages/db/src/errors.ts:600](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L600) An internal sync-queue invariant failed: a cancel targeted a transaction that is not the open last one, or replaying the queue invalidated a @@ -21,7 +21,7 @@ transaction. No public path should reach this. new SyncQueueInvariantError(detail): SyncQueueInvariantError; ``` -Defined in: [packages/db/src/errors.ts:596](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L596) +Defined in: [packages/db/src/errors.ts:601](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L601) #### Parameters diff --git a/docs/reference/classes/SyncRowReusedWithoutPreviousValueError.md b/docs/reference/classes/SyncRowReusedWithoutPreviousValueError.md index f8dfd13a96..8a800e2d0b 100644 --- a/docs/reference/classes/SyncRowReusedWithoutPreviousValueError.md +++ b/docs/reference/classes/SyncRowReusedWithoutPreviousValueError.md @@ -3,7 +3,7 @@ id: SyncRowReusedWithoutPreviousValueError title: SyncRowReusedWithoutPreviousValueError --- -Defined in: [packages/db/src/errors.ts:558](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L558) +Defined in: [packages/db/src/errors.ts:563](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L563) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:558](https://github.com/TanStack/db/blob/ new SyncRowReusedWithoutPreviousValueError(key): SyncRowReusedWithoutPreviousValueError; ``` -Defined in: [packages/db/src/errors.ts:559](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L559) +Defined in: [packages/db/src/errors.ts:564](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L564) #### Parameters diff --git a/docs/reference/classes/SyncTransactionAbortedError.md b/docs/reference/classes/SyncTransactionAbortedError.md index fa79bd5798..34b8d09faf 100644 --- a/docs/reference/classes/SyncTransactionAbortedError.md +++ b/docs/reference/classes/SyncTransactionAbortedError.md @@ -3,7 +3,7 @@ id: SyncTransactionAbortedError title: SyncTransactionAbortedError --- -Defined in: [packages/db/src/errors.ts:1106](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1106) +Defined in: [packages/db/src/errors.ts:1092](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1092) A sync transaction was canceled before its writes became visible. @@ -19,7 +19,7 @@ A sync transaction was canceled before its writes became visible. new SyncTransactionAbortedError(): SyncTransactionAbortedError; ``` -Defined in: [packages/db/src/errors.ts:1107](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1107) +Defined in: [packages/db/src/errors.ts:1093](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1093) #### Returns diff --git a/docs/reference/classes/SyncTransactionAlreadyCommittedError.md b/docs/reference/classes/SyncTransactionAlreadyCommittedError.md index 487864ba22..43df94db0d 100644 --- a/docs/reference/classes/SyncTransactionAlreadyCommittedError.md +++ b/docs/reference/classes/SyncTransactionAlreadyCommittedError.md @@ -3,7 +3,7 @@ id: SyncTransactionAlreadyCommittedError title: SyncTransactionAlreadyCommittedError --- -Defined in: [packages/db/src/errors.ts:580](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L580) +Defined in: [packages/db/src/errors.ts:585](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L585) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:580](https://github.com/TanStack/db/blob/ new SyncTransactionAlreadyCommittedError(): SyncTransactionAlreadyCommittedError; ``` -Defined in: [packages/db/src/errors.ts:581](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L581) +Defined in: [packages/db/src/errors.ts:586](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L586) #### Returns diff --git a/docs/reference/classes/SyncTransactionAlreadyCommittedWriteError.md b/docs/reference/classes/SyncTransactionAlreadyCommittedWriteError.md index aa110bb543..571dca01b7 100644 --- a/docs/reference/classes/SyncTransactionAlreadyCommittedWriteError.md +++ b/docs/reference/classes/SyncTransactionAlreadyCommittedWriteError.md @@ -3,7 +3,7 @@ id: SyncTransactionAlreadyCommittedWriteError title: SyncTransactionAlreadyCommittedWriteError --- -Defined in: [packages/db/src/errors.ts:548](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L548) +Defined in: [packages/db/src/errors.ts:553](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L553) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:548](https://github.com/TanStack/db/blob/ new SyncTransactionAlreadyCommittedWriteError(): SyncTransactionAlreadyCommittedWriteError; ``` -Defined in: [packages/db/src/errors.ts:549](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L549) +Defined in: [packages/db/src/errors.ts:554](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L554) #### Returns diff --git a/docs/reference/classes/ThrottleCallDroppedError.md b/docs/reference/classes/ThrottleCallDroppedError.md index c066403a09..b67886c7ef 100644 --- a/docs/reference/classes/ThrottleCallDroppedError.md +++ b/docs/reference/classes/ThrottleCallDroppedError.md @@ -3,7 +3,7 @@ id: ThrottleCallDroppedError title: ThrottleCallDroppedError --- -Defined in: [packages/db/src/errors.ts:455](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L455) +Defined in: [packages/db/src/errors.ts:460](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L460) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:455](https://github.com/TanStack/db/blob/ new ThrottleCallDroppedError(): ThrottleCallDroppedError; ``` -Defined in: [packages/db/src/errors.ts:456](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L456) +Defined in: [packages/db/src/errors.ts:461](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L461) #### Returns diff --git a/docs/reference/classes/TransactionAlreadyCompletedRollbackError.md b/docs/reference/classes/TransactionAlreadyCompletedRollbackError.md index fdef2d2afb..d39243126d 100644 --- a/docs/reference/classes/TransactionAlreadyCompletedRollbackError.md +++ b/docs/reference/classes/TransactionAlreadyCompletedRollbackError.md @@ -3,7 +3,7 @@ id: TransactionAlreadyCompletedRollbackError title: TransactionAlreadyCompletedRollbackError --- -Defined in: [packages/db/src/errors.ts:508](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L508) +Defined in: [packages/db/src/errors.ts:513](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L513) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:508](https://github.com/TanStack/db/blob/ new TransactionAlreadyCompletedRollbackError(): TransactionAlreadyCompletedRollbackError; ``` -Defined in: [packages/db/src/errors.ts:509](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L509) +Defined in: [packages/db/src/errors.ts:514](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L514) #### Returns diff --git a/docs/reference/classes/TransactionError.md b/docs/reference/classes/TransactionError.md index 9da5fc796d..3909535869 100644 --- a/docs/reference/classes/TransactionError.md +++ b/docs/reference/classes/TransactionError.md @@ -3,7 +3,7 @@ id: TransactionError title: TransactionError --- -Defined in: [packages/db/src/errors.ts:415](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L415) +Defined in: [packages/db/src/errors.ts:420](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L420) ## Extends @@ -37,7 +37,7 @@ Defined in: [packages/db/src/errors.ts:415](https://github.com/TanStack/db/blob/ new TransactionError(message): TransactionError; ``` -Defined in: [packages/db/src/errors.ts:416](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L416) +Defined in: [packages/db/src/errors.ts:421](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L421) #### Parameters diff --git a/docs/reference/classes/TransactionNotPendingCommitError.md b/docs/reference/classes/TransactionNotPendingCommitError.md index 351f36f1af..5bae615e77 100644 --- a/docs/reference/classes/TransactionNotPendingCommitError.md +++ b/docs/reference/classes/TransactionNotPendingCommitError.md @@ -3,7 +3,7 @@ id: TransactionNotPendingCommitError title: TransactionNotPendingCommitError --- -Defined in: [packages/db/src/errors.ts:528](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L528) +Defined in: [packages/db/src/errors.ts:533](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L533) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:528](https://github.com/TanStack/db/blob/ new TransactionNotPendingCommitError(): TransactionNotPendingCommitError; ``` -Defined in: [packages/db/src/errors.ts:529](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L529) +Defined in: [packages/db/src/errors.ts:534](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L534) #### Returns diff --git a/docs/reference/classes/TransactionNotPendingMutateError.md b/docs/reference/classes/TransactionNotPendingMutateError.md index 500d013cb1..67749b4a0b 100644 --- a/docs/reference/classes/TransactionNotPendingMutateError.md +++ b/docs/reference/classes/TransactionNotPendingMutateError.md @@ -3,7 +3,7 @@ id: TransactionNotPendingMutateError title: TransactionNotPendingMutateError --- -Defined in: [packages/db/src/errors.ts:498](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L498) +Defined in: [packages/db/src/errors.ts:503](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L503) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:498](https://github.com/TanStack/db/blob/ new TransactionNotPendingMutateError(): TransactionNotPendingMutateError; ``` -Defined in: [packages/db/src/errors.ts:499](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L499) +Defined in: [packages/db/src/errors.ts:504](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L504) #### Returns diff --git a/docs/reference/classes/UndefinedKeyError.md b/docs/reference/classes/UndefinedKeyError.md index 84cd595b6b..bab13aa350 100644 --- a/docs/reference/classes/UndefinedKeyError.md +++ b/docs/reference/classes/UndefinedKeyError.md @@ -3,7 +3,7 @@ id: UndefinedKeyError title: UndefinedKeyError --- -Defined in: [packages/db/src/errors.ts:240](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L240) +Defined in: [packages/db/src/errors.ts:245](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L245) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:240](https://github.com/TanStack/db/blob/ new UndefinedKeyError(item): UndefinedKeyError; ``` -Defined in: [packages/db/src/errors.ts:241](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L241) +Defined in: [packages/db/src/errors.ts:246](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L246) #### Parameters diff --git a/docs/reference/classes/UnhashableQueryIRError.md b/docs/reference/classes/UnhashableQueryIRError.md index 475eb4d949..6768114fdc 100644 --- a/docs/reference/classes/UnhashableQueryIRError.md +++ b/docs/reference/classes/UnhashableQueryIRError.md @@ -3,7 +3,7 @@ id: UnhashableQueryIRError title: UnhashableQueryIRError --- -Defined in: [packages/db/src/errors.ts:1213](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1213) +Defined in: [packages/db/src/errors.ts:1199](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1199) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1213](https://github.com/TanStack/db/blob new UnhashableQueryIRError(path, reason): UnhashableQueryIRError; ``` -Defined in: [packages/db/src/errors.ts:1214](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1214) +Defined in: [packages/db/src/errors.ts:1200](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1200) #### Parameters @@ -95,7 +95,7 @@ Error.name readonly path: string; ``` -Defined in: [packages/db/src/errors.ts:1215](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1215) +Defined in: [packages/db/src/errors.ts:1201](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1201) *** @@ -105,7 +105,7 @@ Defined in: [packages/db/src/errors.ts:1215](https://github.com/TanStack/db/blob readonly reason: string; ``` -Defined in: [packages/db/src/errors.ts:1216](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1216) +Defined in: [packages/db/src/errors.ts:1202](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1202) *** diff --git a/docs/reference/classes/UnknownExpressionTypeError.md b/docs/reference/classes/UnknownExpressionTypeError.md index 06f748240d..3b69ea6863 100644 --- a/docs/reference/classes/UnknownExpressionTypeError.md +++ b/docs/reference/classes/UnknownExpressionTypeError.md @@ -3,7 +3,7 @@ id: UnknownExpressionTypeError title: UnknownExpressionTypeError --- -Defined in: [packages/db/src/errors.ts:871](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L871) +Defined in: [packages/db/src/errors.ts:857](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L857) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:871](https://github.com/TanStack/db/blob/ new UnknownExpressionTypeError(type): UnknownExpressionTypeError; ``` -Defined in: [packages/db/src/errors.ts:872](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L872) +Defined in: [packages/db/src/errors.ts:858](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L858) #### Parameters diff --git a/docs/reference/classes/UnknownFunctionError.md b/docs/reference/classes/UnknownFunctionError.md index e237fda2c1..9c0065ee33 100644 --- a/docs/reference/classes/UnknownFunctionError.md +++ b/docs/reference/classes/UnknownFunctionError.md @@ -3,7 +3,7 @@ id: UnknownFunctionError title: UnknownFunctionError --- -Defined in: [packages/db/src/errors.ts:891](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L891) +Defined in: [packages/db/src/errors.ts:877](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L877) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:891](https://github.com/TanStack/db/blob/ new UnknownFunctionError(functionName): UnknownFunctionError; ``` -Defined in: [packages/db/src/errors.ts:892](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L892) +Defined in: [packages/db/src/errors.ts:878](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L878) #### Parameters diff --git a/docs/reference/classes/UnknownHavingExpressionTypeError.md b/docs/reference/classes/UnknownHavingExpressionTypeError.md index 260d07dd70..ee07e6d494 100644 --- a/docs/reference/classes/UnknownHavingExpressionTypeError.md +++ b/docs/reference/classes/UnknownHavingExpressionTypeError.md @@ -3,7 +3,7 @@ id: UnknownHavingExpressionTypeError title: UnknownHavingExpressionTypeError --- -Defined in: [packages/db/src/errors.ts:1027](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1027) +Defined in: [packages/db/src/errors.ts:1013](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1013) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1027](https://github.com/TanStack/db/blob new UnknownHavingExpressionTypeError(type): UnknownHavingExpressionTypeError; ``` -Defined in: [packages/db/src/errors.ts:1028](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1028) +Defined in: [packages/db/src/errors.ts:1014](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1014) #### Parameters diff --git a/docs/reference/classes/UnsafeAliasPathError.md b/docs/reference/classes/UnsafeAliasPathError.md index 65f61dad04..21757549f0 100644 --- a/docs/reference/classes/UnsafeAliasPathError.md +++ b/docs/reference/classes/UnsafeAliasPathError.md @@ -3,7 +3,7 @@ id: UnsafeAliasPathError title: UnsafeAliasPathError --- -Defined in: [packages/db/src/errors.ts:724](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L724) +Defined in: [packages/db/src/errors.ts:729](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L729) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:724](https://github.com/TanStack/db/blob/ new UnsafeAliasPathError(segment): UnsafeAliasPathError; ``` -Defined in: [packages/db/src/errors.ts:725](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L725) +Defined in: [packages/db/src/errors.ts:730](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L730) #### Parameters diff --git a/docs/reference/classes/UnsupportedAggregateFunctionError.md b/docs/reference/classes/UnsupportedAggregateFunctionError.md index f077a7ad4b..de978c7dc4 100644 --- a/docs/reference/classes/UnsupportedAggregateFunctionError.md +++ b/docs/reference/classes/UnsupportedAggregateFunctionError.md @@ -3,7 +3,7 @@ id: UnsupportedAggregateFunctionError title: UnsupportedAggregateFunctionError --- -Defined in: [packages/db/src/errors.ts:1007](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1007) +Defined in: [packages/db/src/errors.ts:993](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L993) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:1007](https://github.com/TanStack/db/blob new UnsupportedAggregateFunctionError(functionName): UnsupportedAggregateFunctionError; ``` -Defined in: [packages/db/src/errors.ts:1008](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L1008) +Defined in: [packages/db/src/errors.ts:994](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L994) #### Parameters diff --git a/docs/reference/classes/UnsupportedFnSelectResultError.md b/docs/reference/classes/UnsupportedFnSelectResultError.md index d8172ce29c..19a1d71049 100644 --- a/docs/reference/classes/UnsupportedFnSelectResultError.md +++ b/docs/reference/classes/UnsupportedFnSelectResultError.md @@ -3,7 +3,7 @@ id: UnsupportedFnSelectResultError title: UnsupportedFnSelectResultError --- -Defined in: [packages/db/src/errors.ts:769](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L769) +Defined in: [packages/db/src/errors.ts:774](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L774) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:769](https://github.com/TanStack/db/blob/ new UnsupportedFnSelectResultError(valueDescription): UnsupportedFnSelectResultError; ``` -Defined in: [packages/db/src/errors.ts:770](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L770) +Defined in: [packages/db/src/errors.ts:775](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L775) #### Parameters diff --git a/docs/reference/classes/UnsupportedFromTypeError.md b/docs/reference/classes/UnsupportedFromTypeError.md index 1cdfa1fd6a..c237e1758f 100644 --- a/docs/reference/classes/UnsupportedFromTypeError.md +++ b/docs/reference/classes/UnsupportedFromTypeError.md @@ -3,7 +3,7 @@ id: UnsupportedFromTypeError title: UnsupportedFromTypeError --- -Defined in: [packages/db/src/errors.ts:861](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L861) +Defined in: [packages/db/src/errors.ts:847](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L847) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:861](https://github.com/TanStack/db/blob/ new UnsupportedFromTypeError(type): UnsupportedFromTypeError; ``` -Defined in: [packages/db/src/errors.ts:862](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L862) +Defined in: [packages/db/src/errors.ts:848](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L848) #### Parameters diff --git a/docs/reference/classes/UnsupportedJoinSourceTypeError.md b/docs/reference/classes/UnsupportedJoinSourceTypeError.md index 2fe1bed198..ce6c6d6137 100644 --- a/docs/reference/classes/UnsupportedJoinSourceTypeError.md +++ b/docs/reference/classes/UnsupportedJoinSourceTypeError.md @@ -3,7 +3,7 @@ id: UnsupportedJoinSourceTypeError title: UnsupportedJoinSourceTypeError --- -Defined in: [packages/db/src/errors.ts:979](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L979) +Defined in: [packages/db/src/errors.ts:965](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L965) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:979](https://github.com/TanStack/db/blob/ new UnsupportedJoinSourceTypeError(type): UnsupportedJoinSourceTypeError; ``` -Defined in: [packages/db/src/errors.ts:980](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L980) +Defined in: [packages/db/src/errors.ts:966](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L966) #### Parameters diff --git a/docs/reference/classes/UnsupportedJoinTypeError.md b/docs/reference/classes/UnsupportedJoinTypeError.md index 1311b9138e..9596d12eec 100644 --- a/docs/reference/classes/UnsupportedJoinTypeError.md +++ b/docs/reference/classes/UnsupportedJoinTypeError.md @@ -3,7 +3,7 @@ id: UnsupportedJoinTypeError title: UnsupportedJoinTypeError --- -Defined in: [packages/db/src/errors.ts:919](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L919) +Defined in: [packages/db/src/errors.ts:905](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L905) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:919](https://github.com/TanStack/db/blob/ new UnsupportedJoinTypeError(joinType): UnsupportedJoinTypeError; ``` -Defined in: [packages/db/src/errors.ts:920](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L920) +Defined in: [packages/db/src/errors.ts:906](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L906) #### Parameters diff --git a/docs/reference/classes/UnsupportedRootScalarSelectError.md b/docs/reference/classes/UnsupportedRootScalarSelectError.md index 472425afaf..869e5a5ff6 100644 --- a/docs/reference/classes/UnsupportedRootScalarSelectError.md +++ b/docs/reference/classes/UnsupportedRootScalarSelectError.md @@ -3,7 +3,7 @@ id: UnsupportedRootScalarSelectError title: UnsupportedRootScalarSelectError --- -Defined in: [packages/db/src/errors.ts:781](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L781) +Defined in: [packages/db/src/errors.ts:786](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L786) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:781](https://github.com/TanStack/db/blob/ new UnsupportedRootScalarSelectError(): UnsupportedRootScalarSelectError; ``` -Defined in: [packages/db/src/errors.ts:782](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L782) +Defined in: [packages/db/src/errors.ts:787](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L787) #### Returns diff --git a/docs/reference/classes/UpdateKeyNotFoundError.md b/docs/reference/classes/UpdateKeyNotFoundError.md index 433c47f333..5b6723a2b9 100644 --- a/docs/reference/classes/UpdateKeyNotFoundError.md +++ b/docs/reference/classes/UpdateKeyNotFoundError.md @@ -3,7 +3,7 @@ id: UpdateKeyNotFoundError title: UpdateKeyNotFoundError --- -Defined in: [packages/db/src/errors.ts:336](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L336) +Defined in: [packages/db/src/errors.ts:341](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L341) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/errors.ts:336](https://github.com/TanStack/db/blob/ new UpdateKeyNotFoundError(key): UpdateKeyNotFoundError; ``` -Defined in: [packages/db/src/errors.ts:337](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L337) +Defined in: [packages/db/src/errors.ts:342](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L342) #### Parameters diff --git a/docs/reference/convex-db-collection/functions/convexCollectionOptions.md b/docs/reference/convex-db-collection/functions/convexCollectionOptions.md index 474b327313..69d7e74881 100644 --- a/docs/reference/convex-db-collection/functions/convexCollectionOptions.md +++ b/docs/reference/convex-db-collection/functions/convexCollectionOptions.md @@ -7,7 +7,7 @@ title: convexCollectionOptions function convexCollectionOptions(config): CollectionConfig & object & [TSchema] extends [never] ? unknown : object; ``` -Defined in: [index.ts:48](https://github.com/tanstack/db/blob/main/packages/convex-db-collection/src/index.ts#L48) +Defined in: [index.ts:48](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/index.ts#L48) Mirror one authoritative Convex query result. Filters and joins run in DB. diff --git a/docs/reference/convex-db-collection/functions/convexPaginatedCollectionOptions.md b/docs/reference/convex-db-collection/functions/convexPaginatedCollectionOptions.md index 1cbe74a6d8..d9293b3a82 100644 --- a/docs/reference/convex-db-collection/functions/convexPaginatedCollectionOptions.md +++ b/docs/reference/convex-db-collection/functions/convexPaginatedCollectionOptions.md @@ -7,9 +7,9 @@ title: convexPaginatedCollectionOptions function convexPaginatedCollectionOptions(config): CollectionConfig & object & [TSchema] extends [never] ? unknown : object; ``` -Defined in: [paginated-options.ts:53](https://github.com/tanstack/db/blob/main/packages/convex-db-collection/src/paginated-options.ts#L53) +Defined in: [paginated-options.ts:70](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/paginated-options.ts#L70) -Automatically subscribe to every page, retaining fixed reactive cursor ranges. +Retain reactive cursor ranges; on-demand mode acquires only the prefix needed by active subsets. ## Type Parameters diff --git a/docs/reference/convex-db-collection/index.md b/docs/reference/convex-db-collection/index.md index 8650166963..0f5f12c5e2 100644 --- a/docs/reference/convex-db-collection/index.md +++ b/docs/reference/convex-db-collection/index.md @@ -12,6 +12,7 @@ title: "@tanstack/convex-db-collection" - [ConvexCollectionClient](type-aliases/ConvexCollectionClient.md) - [ConvexCollectionConfig](type-aliases/ConvexCollectionConfig.md) - [ConvexPaginatedCollectionConfig](type-aliases/ConvexPaginatedCollectionConfig.md) +- [ConvexQueryOrder](type-aliases/ConvexQueryOrder.md) ## Functions diff --git a/docs/reference/convex-db-collection/interfaces/ConvexCollectionUtils.md b/docs/reference/convex-db-collection/interfaces/ConvexCollectionUtils.md index c2a658d997..745fa648d5 100644 --- a/docs/reference/convex-db-collection/interfaces/ConvexCollectionUtils.md +++ b/docs/reference/convex-db-collection/interfaces/ConvexCollectionUtils.md @@ -3,7 +3,7 @@ id: ConvexCollectionUtils title: ConvexCollectionUtils --- -Defined in: [options.ts:15](https://github.com/tanstack/db/blob/main/packages/convex-db-collection/src/options.ts#L15) +Defined in: [options.ts:15](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/options.ts#L15) ## Extends @@ -23,7 +23,7 @@ Defined in: [options.ts:15](https://github.com/tanstack/db/blob/main/packages/co awaitSync: () => Promise; ``` -Defined in: [options.ts:19](https://github.com/tanstack/db/blob/main/packages/convex-db-collection/src/options.ts#L19) +Defined in: [options.ts:19](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/options.ts#L19) Refresh the source cache and wait for sync acceptance, safe inside mutation handlers. @@ -39,7 +39,7 @@ Refresh the source cache and wait for sync acceptance, safe inside mutation hand getSyncError: () => unknown; ``` -Defined in: [options.ts:17](https://github.com/tanstack/db/blob/main/packages/convex-db-collection/src/options.ts#L17) +Defined in: [options.ts:17](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/options.ts#L17) Last subscription or conversion error, cleared by the next valid result. diff --git a/docs/reference/convex-db-collection/offline/functions/convexOfflineMutation.md b/docs/reference/convex-db-collection/offline/functions/convexOfflineMutation.md index c6aca1a944..c55ef24710 100644 --- a/docs/reference/convex-db-collection/offline/functions/convexOfflineMutation.md +++ b/docs/reference/convex-db-collection/offline/functions/convexOfflineMutation.md @@ -7,7 +7,7 @@ title: convexOfflineMutation function convexOfflineMutation(config): OfflineMutationFn; ``` -Defined in: [offline.ts:21](https://github.com/tanstack/db/blob/main/packages/convex-db-collection/src/offline.ts#L21) +Defined in: [offline.ts:21](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/offline.ts#L21) Use as a named mutationFn in startOfflineExecutor. The existing outbox owns durability, restoration, leadership and retries. The server mutation must diff --git a/docs/reference/convex-db-collection/offline/variables/convexMutationCodec.md b/docs/reference/convex-db-collection/offline/variables/convexMutationCodec.md index 923ca3fdd3..c7528a30a8 100644 --- a/docs/reference/convex-db-collection/offline/variables/convexMutationCodec.md +++ b/docs/reference/convex-db-collection/offline/variables/convexMutationCodec.md @@ -7,6 +7,6 @@ title: convexMutationCodec const convexMutationCodec: MutationValueCodec; ``` -Defined in: [offline.ts:59](https://github.com/tanstack/db/blob/main/packages/convex-db-collection/src/offline.ts#L59) +Defined in: [offline.ts:59](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/offline.ts#L59) Lossless, opt-in outbox encoding for Convex values and removed fields. diff --git a/docs/reference/convex-db-collection/type-aliases/ConvexCollectionClient.md b/docs/reference/convex-db-collection/type-aliases/ConvexCollectionClient.md index 993938f0d0..cbfb59667d 100644 --- a/docs/reference/convex-db-collection/type-aliases/ConvexCollectionClient.md +++ b/docs/reference/convex-db-collection/type-aliases/ConvexCollectionClient.md @@ -9,4 +9,4 @@ type ConvexCollectionClient = | Pick; ``` -Defined in: [subscription.ts:9](https://github.com/tanstack/db/blob/main/packages/convex-db-collection/src/subscription.ts#L9) +Defined in: [subscription.ts:10](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/subscription.ts#L10) diff --git a/docs/reference/convex-db-collection/type-aliases/ConvexCollectionConfig.md b/docs/reference/convex-db-collection/type-aliases/ConvexCollectionConfig.md index e5eb698e7e..8e7c3ca1de 100644 --- a/docs/reference/convex-db-collection/type-aliases/ConvexCollectionConfig.md +++ b/docs/reference/convex-db-collection/type-aliases/ConvexCollectionConfig.md @@ -4,14 +4,14 @@ title: ConvexCollectionConfig --- ```ts -type ConvexCollectionConfig = Omit, "syncMode" | "utils" | "schema"> & object & [TSchema] extends [never] ? object : object & +type ConvexCollectionConfig = Omit, "syncMode" | "utils" | "schema"> & object & [TSchema] extends [never] ? object : object & | { select: (result) => ReadonlyArray; } | FunctionReturnType extends ReadonlyArray ? object : never; ``` -Defined in: [index.ts:21](https://github.com/tanstack/db/blob/main/packages/convex-db-collection/src/index.ts#L21) +Defined in: [index.ts:21](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/index.ts#L21) ## Type Declaration diff --git a/docs/reference/convex-db-collection/type-aliases/ConvexPaginatedCollectionConfig.md b/docs/reference/convex-db-collection/type-aliases/ConvexPaginatedCollectionConfig.md index b9d3695d3a..8270e73207 100644 --- a/docs/reference/convex-db-collection/type-aliases/ConvexPaginatedCollectionConfig.md +++ b/docs/reference/convex-db-collection/type-aliases/ConvexPaginatedCollectionConfig.md @@ -4,14 +4,16 @@ title: ConvexPaginatedCollectionConfig --- ```ts -type ConvexPaginatedCollectionConfig = Omit, "syncMode" | "utils" | "schema"> & object & [TSchema] extends [never] ? object : object & FunctionReturnType extends PaginationResult ? unknown : never & FunctionArgs extends object ? unknown : never & +type ConvexPaginatedCollectionConfig = Omit, "syncMode" | "utils" | "schema"> & object & [TSchema] extends [never] ? object : object & FunctionReturnType extends PaginationResult ? unknown : never & FunctionArgs extends object ? unknown : never & + | object & | { select: (rows) => ReadonlyArray; } - | PaginatedRow extends TItem ? object : never; + | PaginatedRow extends TItem ? object : never + | object & PaginatedRow extends TItem ? unknown : never; ``` -Defined in: [paginated-options.ts:20](https://github.com/tanstack/db/blob/main/packages/convex-db-collection/src/paginated-options.ts#L20) +Defined in: [paginated-options.ts:30](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/paginated-options.ts#L30) ## Type Declaration @@ -27,7 +29,7 @@ client: ConvexCollectionClient; optional maxRows: number; ``` -Maximum accepted rows in the complete eager mirror. Defaults to 10,000. +Maximum accepted rows in the retained query prefix. Defaults to 10,000. ### onError()? diff --git a/docs/reference/convex-db-collection/type-aliases/ConvexQueryOrder.md b/docs/reference/convex-db-collection/type-aliases/ConvexQueryOrder.md new file mode 100644 index 0000000000..73ea817307 --- /dev/null +++ b/docs/reference/convex-db-collection/type-aliases/ConvexQueryOrder.md @@ -0,0 +1,39 @@ +--- +id: ConvexQueryOrder +title: ConvexQueryOrder +--- + +```ts +type ConvexQueryOrder = object; +``` + +Defined in: [paginated-options.ts:22](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/paginated-options.ts#L22) + +Leading numeric order of the fixed server query. Trailing DB order terms +are local: each acquisition establishes the complete leading-value tie. + +## Type Parameters + +### TRow + +`TRow` + +## Properties + +### direction + +```ts +direction: "asc" | "desc"; +``` + +Defined in: [paginated-options.ts:27](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/paginated-options.ts#L27) + +*** + +### field + +```ts +field: { [K in keyof TRow]-?: TRow[K] extends number ? K : never }[keyof TRow] & string; +``` + +Defined in: [paginated-options.ts:23](https://github.com/TanStack/db/blob/main/packages/convex-db-collection/src/paginated-options.ts#L23) diff --git a/docs/reference/electric-db-collection/functions/electricCollectionOptions.md b/docs/reference/electric-db-collection/functions/electricCollectionOptions.md index 669820845f..cdf5bc1a89 100644 --- a/docs/reference/electric-db-collection/functions/electricCollectionOptions.md +++ b/docs/reference/electric-db-collection/functions/electricCollectionOptions.md @@ -9,7 +9,7 @@ title: electricCollectionOptions function electricCollectionOptions(config): Omit, string | number, T, UtilsRecord>, "utils" | "onInsert" | "onUpdate" | "onDelete"> & Pick, T>, "onInsert" | "onUpdate" | "onDelete"> & object; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:1170](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L1170) +Defined in: [packages/electric-db-collection/src/electric.ts:1150](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L1150) Creates Electric collection options for use with a standard Collection @@ -41,7 +41,7 @@ Collection options with utilities function electricCollectionOptions(config): Omit, "utils" | "onInsert" | "onUpdate" | "onDelete"> & Pick, "onInsert" | "onUpdate" | "onDelete"> & object; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:1188](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L1188) +Defined in: [packages/electric-db-collection/src/electric.ts:1168](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L1168) Creates Electric collection options for use with a standard Collection diff --git a/docs/reference/electric-db-collection/interfaces/ElectricCollectionConfig.md b/docs/reference/electric-db-collection/interfaces/ElectricCollectionConfig.md index 36ce4d0ae1..6769427ce7 100644 --- a/docs/reference/electric-db-collection/interfaces/ElectricCollectionConfig.md +++ b/docs/reference/electric-db-collection/interfaces/ElectricCollectionConfig.md @@ -3,7 +3,7 @@ id: ElectricCollectionConfig title: ElectricCollectionConfig --- -Defined in: [packages/electric-db-collection/src/electric.ts:345](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L345) +Defined in: [packages/electric-db-collection/src/electric.ts:330](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L330) Configuration interface for Electric collection options @@ -33,7 +33,7 @@ The schema type for validation optional [ELECTRIC_TEST_HOOKS]: ElectricTestHooks; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:362](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L362) +Defined in: [packages/electric-db-collection/src/electric.ts:347](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L347) Internal test hooks (for testing only) Hidden via Symbol to prevent accidental usage in production @@ -43,10 +43,10 @@ Hidden via Symbol to prevent accidental usage in production ### onDelete()? ```ts -optional onDelete: (params) => Promise; +optional onDelete: (params) => Promise; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:548](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L548) +Defined in: [packages/electric-db-collection/src/electric.ts:524](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L524) Optional asynchronous handler function called before a delete operation @@ -68,13 +68,10 @@ Object containing transaction and collection information #### Returns -`Promise`\<`MatchingStrategy`\> +`Promise`\<`void`\> Promise that should resolve after synchronization is complete -**Deprecation notice:** Returning `{ txid }` from handlers is deprecated and will be removed in v1.0. -Use `await collection.utils.awaitTxId(txid)` within the handler instead. - #### Examples ```ts @@ -108,10 +105,10 @@ onDelete: async ({ transaction, collection }) => { ### onInsert()? ```ts -optional onInsert: (params) => Promise; +optional onInsert: (params) => Promise; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:449](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L449) +Defined in: [packages/electric-db-collection/src/electric.ts:431](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L431) Optional asynchronous handler function called before an insert operation @@ -133,13 +130,10 @@ Object containing transaction and collection information #### Returns -`Promise`\<`MatchingStrategy`\> +`Promise`\<`void`\> Promise that should resolve after synchronization is complete -**Deprecation notice:** Returning `{ txid }` from handlers is deprecated and will be removed in v1.0. -Use `await collection.utils.awaitTxId(txid)` within the handler instead. - #### Examples ```ts @@ -220,10 +214,10 @@ onInsert: async ({ transaction, collection }) => { ### onUpdate()? ```ts -optional onUpdate: (params) => Promise; +optional onUpdate: (params) => Promise; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:499](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L499) +Defined in: [packages/electric-db-collection/src/electric.ts:478](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L478) Optional asynchronous handler function called before an update operation @@ -245,13 +239,10 @@ Object containing transaction and collection information #### Returns -`Promise`\<`MatchingStrategy`\> +`Promise`\<`void`\> Promise that should resolve after synchronization is complete -**Deprecation notice:** Returning `{ txid }` from handlers is deprecated and will be removed in v1.0. -Use `await collection.utils.awaitTxId(txid)` within the handler instead. - #### Examples ```ts @@ -289,7 +280,7 @@ onUpdate: async ({ transaction, collection }) => { shapeOptions: ShapeStreamOptions>; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:355](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L355) +Defined in: [packages/electric-db-collection/src/electric.ts:340](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L340) Configuration options for the ElectricSQL ShapeStream @@ -301,4 +292,4 @@ Configuration options for the ElectricSQL ShapeStream optional syncMode: ElectricSyncMode; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:356](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L356) +Defined in: [packages/electric-db-collection/src/electric.ts:341](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L341) diff --git a/docs/reference/electric-db-collection/interfaces/ElectricCollectionUtils.md b/docs/reference/electric-db-collection/interfaces/ElectricCollectionUtils.md index 8e72864d77..91a77aefc5 100644 --- a/docs/reference/electric-db-collection/interfaces/ElectricCollectionUtils.md +++ b/docs/reference/electric-db-collection/interfaces/ElectricCollectionUtils.md @@ -3,7 +3,7 @@ id: ElectricCollectionUtils title: ElectricCollectionUtils --- -Defined in: [packages/electric-db-collection/src/electric.ts:906](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L906) +Defined in: [packages/electric-db-collection/src/electric.ts:886](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L886) Electric collection utilities type @@ -21,7 +21,7 @@ Electric collection utilities type awaitMatch: AwaitMatchFn; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:912](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L912) +Defined in: [packages/electric-db-collection/src/electric.ts:892](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L892) *** @@ -31,4 +31,4 @@ Defined in: [packages/electric-db-collection/src/electric.ts:912](https://github awaitTxId: AwaitTxIdFn; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:911](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L911) +Defined in: [packages/electric-db-collection/src/electric.ts:891](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L891) diff --git a/docs/reference/electric-db-collection/type-aliases/AwaitTxIdFn.md b/docs/reference/electric-db-collection/type-aliases/AwaitTxIdFn.md index 6688f5e914..1530205932 100644 --- a/docs/reference/electric-db-collection/type-aliases/AwaitTxIdFn.md +++ b/docs/reference/electric-db-collection/type-aliases/AwaitTxIdFn.md @@ -7,9 +7,13 @@ title: AwaitTxIdFn type AwaitTxIdFn = (txId, timeout?) => Promise; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:893](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L893) +Defined in: [packages/electric-db-collection/src/electric.ts:873](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L873) -Type for the awaitTxId utility function +Type for the awaitTxId utility function. It resolves when the txid +appears in the Electric stream (the server's confirmation), before this +tab's persistence accepts the transaction. If that commit later rejects, +the source fails instead, and the Collection's health node records it +(maintainer decision on PR #2265). ## Parameters diff --git a/docs/reference/electric-db-collection/type-aliases/Txid.md b/docs/reference/electric-db-collection/type-aliases/Txid.md index d2370c415e..c6f093ade9 100644 --- a/docs/reference/electric-db-collection/type-aliases/Txid.md +++ b/docs/reference/electric-db-collection/type-aliases/Txid.md @@ -7,6 +7,6 @@ title: Txid type Txid = number; ``` -Defined in: [packages/electric-db-collection/src/electric.ts:96](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L96) +Defined in: [packages/electric-db-collection/src/electric.ts:95](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L95) Type representing a transaction ID in ElectricSQL diff --git a/docs/reference/functions/bindLiveQueryWindow.md b/docs/reference/functions/bindLiveQueryWindow.md index 10befb4bb5..550c568c0c 100644 --- a/docs/reference/functions/bindLiveQueryWindow.md +++ b/docs/reference/functions/bindLiveQueryWindow.md @@ -10,7 +10,7 @@ function bindLiveQueryWindow( uncommitted?): LiveQueryWindowBinding; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:120](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L120) +Defined in: [packages/db/src/live-query-window-binding.ts:119](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L119) Bind an infinite-query update. Returns `previous` when it still serves the update; otherwise returns a new binding whose controller the adapter diff --git a/docs/reference/functions/collectionOptions.md b/docs/reference/functions/collectionOptions.md index f81f2e8b80..6dae830e0f 100644 --- a/docs/reference/functions/collectionOptions.md +++ b/docs/reference/functions/collectionOptions.md @@ -9,7 +9,7 @@ title: collectionOptions function collectionOptions(options): CollectionOptions, TKey, T, TUtils> & NonSingleResult; ``` -Defined in: [packages/db/src/client.ts:214](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L214) +Defined in: [packages/db/src/client.ts:222](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L222) ### Type Parameters @@ -41,7 +41,7 @@ Defined in: [packages/db/src/client.ts:214](https://github.com/TanStack/db/blob/ function collectionOptions(options): CollectionOptions, TKey, T, TUtils> & SingleResult; ``` -Defined in: [packages/db/src/client.ts:223](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L223) +Defined in: [packages/db/src/client.ts:231](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L231) ### Type Parameters @@ -73,7 +73,7 @@ Defined in: [packages/db/src/client.ts:223](https://github.com/TanStack/db/blob/ function collectionOptions(options): CollectionOptions & NonSingleResult; ``` -Defined in: [packages/db/src/client.ts:232](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L232) +Defined in: [packages/db/src/client.ts:240](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L240) ### Type Parameters @@ -105,7 +105,7 @@ Defined in: [packages/db/src/client.ts:232](https://github.com/TanStack/db/blob/ function collectionOptions(options): CollectionOptions & SingleResult; ``` -Defined in: [packages/db/src/client.ts:241](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L241) +Defined in: [packages/db/src/client.ts:249](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L249) ### Type Parameters @@ -137,7 +137,7 @@ Defined in: [packages/db/src/client.ts:241](https://github.com/TanStack/db/blob/ function collectionOptions(id, factory): DescriptorFromConfig; ``` -Defined in: [packages/db/src/client.ts:250](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L250) +Defined in: [packages/db/src/client.ts:258](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L258) ### Type Parameters diff --git a/docs/reference/functions/configPool.md b/docs/reference/functions/configPool.md index f352686e4c..290db78342 100644 --- a/docs/reference/functions/configPool.md +++ b/docs/reference/functions/configPool.md @@ -14,7 +14,7 @@ function configPool(config): | undefined; ``` -Defined in: [packages/db/src/live-query-options.ts:35](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L35) +Defined in: [packages/db/src/live-query-options.ts:36](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L36) A hook config's pool: `pooledLiveQueries` or nothing. Any other value, such as the removed boolean form, contradicts the hook contract, so every reader diff --git a/docs/reference/functions/createEffect.md b/docs/reference/functions/createEffect.md index 16906d47bd..49102fed48 100644 --- a/docs/reference/functions/createEffect.md +++ b/docs/reference/functions/createEffect.md @@ -7,7 +7,7 @@ title: createEffect function createEffect(config): Effect; ``` -Defined in: [packages/db/src/query/effect.ts:226](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L226) +Defined in: [packages/db/src/query/effect.ts:227](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L227) ## Type Parameters diff --git a/docs/reference/functions/createLiveQueryObserver.md b/docs/reference/functions/createLiveQueryObserver.md index 2c9a8fd9f0..e00498c7df 100644 --- a/docs/reference/functions/createLiveQueryObserver.md +++ b/docs/reference/functions/createLiveQueryObserver.md @@ -7,7 +7,7 @@ title: createLiveQueryObserver function createLiveQueryObserver(collection, options): LiveQueryObserver; ``` -Defined in: [packages/db/src/live-query-observer.ts:829](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L829) +Defined in: [packages/db/src/live-query-observer.ts:824](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L824) **`Internal`** diff --git a/docs/reference/functions/createLiveQueryWindowController.md b/docs/reference/functions/createLiveQueryWindowController.md index 8b385f3957..ba5e8d0e44 100644 --- a/docs/reference/functions/createLiveQueryWindowController.md +++ b/docs/reference/functions/createLiveQueryWindowController.md @@ -7,7 +7,7 @@ title: createLiveQueryWindowController function createLiveQueryWindowController(collection, options): LiveQueryWindowController; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:1011](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L1011) +Defined in: [packages/db/src/live-query-window-controller.ts:1014](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L1014) **`Internal`** diff --git a/docs/reference/functions/createTransaction.md b/docs/reference/functions/createTransaction.md index fb802cf75d..c6b843893f 100644 --- a/docs/reference/functions/createTransaction.md +++ b/docs/reference/functions/createTransaction.md @@ -7,7 +7,7 @@ title: createTransaction function createTransaction(config): Transaction; ``` -Defined in: [packages/db/src/transactions.ts:344](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L344) +Defined in: [packages/db/src/transactions.ts:319](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L319) Creates a new transaction for grouping multiple collection operations diff --git a/docs/reference/functions/deepEquals.md b/docs/reference/functions/deepEquals.md index 51f5309aea..e0177430f6 100644 --- a/docs/reference/functions/deepEquals.md +++ b/docs/reference/functions/deepEquals.md @@ -7,7 +7,7 @@ title: deepEquals function deepEquals(a, b): boolean; ``` -Defined in: [packages/db/src/utils.ts:43](https://github.com/TanStack/db/blob/main/packages/db/src/utils.ts#L43) +Defined in: [packages/db/src/utils.ts:44](https://github.com/TanStack/db/blob/main/packages/db/src/utils.ts#L44) Deep equality function that compares two values recursively Handles primitives, objects, arrays, Date, RegExp, Map, Set, TypedArrays, and Temporal objects diff --git a/docs/reference/functions/equalPersistedSnapshotValues.md b/docs/reference/functions/equalPersistedSnapshotValues.md index 99a09fa20c..455bd1b37b 100644 --- a/docs/reference/functions/equalPersistedSnapshotValues.md +++ b/docs/reference/functions/equalPersistedSnapshotValues.md @@ -7,7 +7,7 @@ title: equalPersistedSnapshotValues function equalPersistedSnapshotValues(a, b): boolean; ``` -Defined in: [packages/db/src/utils.ts:48](https://github.com/TanStack/db/blob/main/packages/db/src/utils.ts#L48) +Defined in: [packages/db/src/utils.ts:49](https://github.com/TanStack/db/blob/main/packages/db/src/utils.ts#L49) **`Internal`** diff --git a/docs/reference/functions/fetchNextLiveQueryWindowPage.md b/docs/reference/functions/fetchNextLiveQueryWindowPage.md index c0dcd27f22..68e2fa203c 100644 --- a/docs/reference/functions/fetchNextLiveQueryWindowPage.md +++ b/docs/reference/functions/fetchNextLiveQueryWindowPage.md @@ -7,7 +7,7 @@ title: fetchNextLiveQueryWindowPage function fetchNextLiveQueryWindowPage(controller): Promise; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:574](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L574) +Defined in: [packages/db/src/live-query-window-controller.ts:577](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L577) **`Internal`** diff --git a/docs/reference/functions/getActiveTransaction.md b/docs/reference/functions/getActiveTransaction.md index 34aa41a916..2d18654e24 100644 --- a/docs/reference/functions/getActiveTransaction.md +++ b/docs/reference/functions/getActiveTransaction.md @@ -9,7 +9,7 @@ function getActiveTransaction(): | undefined; ``` -Defined in: [packages/db/src/transactions.ts:361](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L361) +Defined in: [packages/db/src/transactions.ts:336](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L336) Gets the currently active ambient transaction, if any Used internally by collection operations to join existing transactions diff --git a/docs/reference/functions/getLiveQueryHash.md b/docs/reference/functions/getLiveQueryHash.md index 35c66185a8..bf63ffac71 100644 --- a/docs/reference/functions/getLiveQueryHash.md +++ b/docs/reference/functions/getLiveQueryHash.md @@ -7,7 +7,7 @@ title: getLiveQueryHash function getLiveQueryHash(preparedValue, queryKey?): string; ``` -Defined in: [packages/db/src/live-query-options.ts:291](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L291) +Defined in: [packages/db/src/live-query-options.ts:307](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L307) ## Parameters diff --git a/docs/reference/functions/getLiveQueryStatusFlags.md b/docs/reference/functions/getLiveQueryStatusFlags.md index 12a6d6ff3c..1d2e3a4c27 100644 --- a/docs/reference/functions/getLiveQueryStatusFlags.md +++ b/docs/reference/functions/getLiveQueryStatusFlags.md @@ -4,13 +4,14 @@ title: getLiveQueryStatusFlags --- ```ts -function getLiveQueryStatusFlags(status): LiveQueryStatusFlags; +function getLiveQueryStatusFlags(status, health?): LiveQueryStatusFlags; ``` -Defined in: [packages/db/src/live-query-primitives.ts:67](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L67) +Defined in: [packages/db/src/live-query-primitives.ts:87](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L87) -Derive the boolean status flags from a collection status. Adapters represent -a disabled query separately (with `isReady: true`); this covers the real +Derive the status flags from a collection status and its health tree. This is +the one place the `isSyncError` rule is written. Adapters represent a disabled +query separately (with `isReady: true`); this covers the real `CollectionStatus` values. ## Parameters @@ -19,6 +20,10 @@ a disabled query separately (with `isReady: true`); this covers the real [`CollectionStatus`](../type-aliases/CollectionStatus.md) +### health? + +[`HealthNode`](../interfaces/HealthNode.md) + ## Returns [`LiveQueryStatusFlags`](../interfaces/LiveQueryStatusFlags.md) diff --git a/docs/reference/functions/getPreparedLiveQueryIdentity.md b/docs/reference/functions/getPreparedLiveQueryIdentity.md index 59281e9630..c431701c1e 100644 --- a/docs/reference/functions/getPreparedLiveQueryIdentity.md +++ b/docs/reference/functions/getPreparedLiveQueryIdentity.md @@ -7,7 +7,7 @@ title: getPreparedLiveQueryIdentity function getPreparedLiveQueryIdentity(value, pool?): unknown; ``` -Defined in: [packages/db/src/live-query-options.ts:260](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L260) +Defined in: [packages/db/src/live-query-options.ts:276](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L276) ## Parameters diff --git a/docs/reference/functions/getPreparedLiveQuerySources.md b/docs/reference/functions/getPreparedLiveQuerySources.md index de7db72381..6459aa4ae0 100644 --- a/docs/reference/functions/getPreparedLiveQuerySources.md +++ b/docs/reference/functions/getPreparedLiveQuerySources.md @@ -7,7 +7,7 @@ title: getPreparedLiveQuerySources function getPreparedLiveQuerySources(value, onUnboundDescriptor?): Collection, string | number, UtilsRecord, StandardSchemaV1, Record>[]; ``` -Defined in: [packages/db/src/live-query-options.ts:237](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L237) +Defined in: [packages/db/src/live-query-options.ts:235](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L235) Concrete source objects in query-position order for a prepared value. diff --git a/docs/reference/functions/hasVirtualProps.md b/docs/reference/functions/hasVirtualProps.md index 71b94b4d7a..a967d6234c 100644 --- a/docs/reference/functions/hasVirtualProps.md +++ b/docs/reference/functions/hasVirtualProps.md @@ -7,11 +7,9 @@ title: hasVirtualProps function hasVirtualProps(value): value is VirtualRowProps; ``` -Defined in: [packages/db/src/virtual-props.ts:194](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L194) +Defined in: [packages/db/src/virtual-props.ts:167](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L167) -Checks if a value has virtual properties attached. Legacy rows with the -original four properties still match; only rows published by this version -are guaranteed to carry `$hasPendingWrites`. +Checks if a value has all virtual properties attached. ## Parameters @@ -30,7 +28,7 @@ true if the value has virtual properties ## Example ```typescript -if (hasVirtualProps(row) && row.$hasPendingWrites !== undefined) { +if (hasVirtualProps(row)) { console.log('Pending local writes:', row.$hasPendingWrites) } ``` diff --git a/docs/reference/functions/isCollectionOptions.md b/docs/reference/functions/isCollectionOptions.md index 380bec38ac..c904c2c1f8 100644 --- a/docs/reference/functions/isCollectionOptions.md +++ b/docs/reference/functions/isCollectionOptions.md @@ -7,7 +7,7 @@ title: isCollectionOptions function isCollectionOptions(value): value is CollectionOptions; ``` -Defined in: [packages/db/src/client.ts:342](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L342) +Defined in: [packages/db/src/client.ts:350](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L350) ## Parameters diff --git a/docs/reference/functions/isFailedStatus.md b/docs/reference/functions/isFailedStatus.md new file mode 100644 index 0000000000..9a5fed8286 --- /dev/null +++ b/docs/reference/functions/isFailedStatus.md @@ -0,0 +1,22 @@ +--- +id: isFailedStatus +title: isFailedStatus +--- + +```ts +function isFailedStatus(status): boolean; +``` + +Defined in: [packages/db/src/live-query-primitives.ts:51](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L51) + +`error` and `crashed` end a sync run before it can serve its result. + +## Parameters + +### status + +[`CollectionStatus`](../type-aliases/CollectionStatus.md) + +## Returns + +`boolean` diff --git a/docs/reference/functions/localOnlyCollectionOptions.md b/docs/reference/functions/localOnlyCollectionOptions.md index 6a4c4a539a..681559dcac 100644 --- a/docs/reference/functions/localOnlyCollectionOptions.md +++ b/docs/reference/functions/localOnlyCollectionOptions.md @@ -9,7 +9,7 @@ title: localOnlyCollectionOptions function localOnlyCollectionOptions(config): CollectionConfig, TKey, T, LocalOnlyCollectionUtils> & object & object; ``` -Defined in: [packages/db/src/local-only.ts:151](https://github.com/TanStack/db/blob/main/packages/db/src/local-only.ts#L151) +Defined in: [packages/db/src/local-only.ts:152](https://github.com/TanStack/db/blob/main/packages/db/src/local-only.ts#L152) Creates Local-only collection options for use with a standard Collection @@ -121,7 +121,7 @@ await tx.commit() function localOnlyCollectionOptions(config): CollectionConfig & object & object; ``` -Defined in: [packages/db/src/local-only.ts:164](https://github.com/TanStack/db/blob/main/packages/db/src/local-only.ts#L164) +Defined in: [packages/db/src/local-only.ts:165](https://github.com/TanStack/db/blob/main/packages/db/src/local-only.ts#L165) Creates Local-only collection options for use with a standard Collection diff --git a/docs/reference/functions/prepareLiveQueryValue.md b/docs/reference/functions/prepareLiveQueryValue.md index 1ba5ddf73d..5a6af9c8eb 100644 --- a/docs/reference/functions/prepareLiveQueryValue.md +++ b/docs/reference/functions/prepareLiveQueryValue.md @@ -10,7 +10,7 @@ function prepareLiveQueryValue( deferredCollections?): unknown; ``` -Defined in: [packages/db/src/live-query-options.ts:179](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L179) +Defined in: [packages/db/src/live-query-options.ts:177](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L177) ## Parameters diff --git a/docs/reference/functions/readLiveQueryWindowPageShape.md b/docs/reference/functions/readLiveQueryWindowPageShape.md index 362da337e7..8b04d20fbe 100644 --- a/docs/reference/functions/readLiveQueryWindowPageShape.md +++ b/docs/reference/functions/readLiveQueryWindowPageShape.md @@ -7,7 +7,7 @@ title: readLiveQueryWindowPageShape function readLiveQueryWindowPageShape(config): LiveQueryWindowPageShape; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:47](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L47) +Defined in: [packages/db/src/live-query-window-binding.ts:48](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L48) Read an infinite-query config's page shape. `getNextPageParam` is rejected: the hook widens an ordered live query and has no server cursor to advance. diff --git a/docs/reference/functions/rejectLiveQueryInput.md b/docs/reference/functions/rejectLiveQueryInput.md index 3d8f673e8e..f1d7493d5e 100644 --- a/docs/reference/functions/rejectLiveQueryInput.md +++ b/docs/reference/functions/rejectLiveQueryInput.md @@ -7,7 +7,7 @@ title: rejectLiveQueryInput function rejectLiveQueryInput(collections, rejection): never; ``` -Defined in: [packages/db/src/live-query-options.ts:67](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L67) +Defined in: [packages/db/src/live-query-options.ts:68](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L68) Release the sync starts a rejected query input deferred, then rethrow its rejection. A framework hook calls this around its own render work, so a diff --git a/docs/reference/functions/releaseDeferredOnReclaim.md b/docs/reference/functions/releaseDeferredOnReclaim.md index d93167fecc..651333c3b0 100644 --- a/docs/reference/functions/releaseDeferredOnReclaim.md +++ b/docs/reference/functions/releaseDeferredOnReclaim.md @@ -7,7 +7,7 @@ title: releaseDeferredOnReclaim function releaseDeferredOnReclaim(liveQuery, deferredCollections): () => void | undefined; ``` -Defined in: [packages/db/src/live-query-options.ts:93](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L93) +Defined in: [packages/db/src/live-query-options.ts:94](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L94) Release a render's deferred sync starts when the live query it built is reclaimed. A render that commits releases them first, when it subscribes. diff --git a/docs/reference/functions/reportUncaught.md b/docs/reference/functions/reportUncaught.md new file mode 100644 index 0000000000..8d2024183c --- /dev/null +++ b/docs/reference/functions/reportUncaught.md @@ -0,0 +1,23 @@ +--- +id: reportUncaught +title: reportUncaught +--- + +```ts +function reportUncaught(error): void; +``` + +Defined in: [packages/db/src/utils/callbacks.ts:18](https://github.com/TanStack/db/blob/main/packages/db/src/utils/callbacks.ts#L18) + +Report an adapter contract breach, such as an `unloadSubset` that throws, +without changing the caller's result. The error surfaces as uncaught. + +## Parameters + +### error + +`unknown` + +## Returns + +`void` diff --git a/docs/reference/functions/resetWarnings.md b/docs/reference/functions/resetWarnings.md deleted file mode 100644 index 4a9b6c4c08..0000000000 --- a/docs/reference/functions/resetWarnings.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -id: resetWarnings -title: resetWarnings ---- - -```ts -function resetWarnings(): void; -``` - -Defined in: [packages/db/src/utils.ts:447](https://github.com/TanStack/db/blob/main/packages/db/src/utils.ts#L447) - -**`Internal`** - -Reset all warning states. Primarily useful for testing. - - Used by first-party collection adapter tests. - -## Returns - -`void` diff --git a/docs/reference/functions/resolveLiveQueryValue.md b/docs/reference/functions/resolveLiveQueryValue.md index 6317021fd2..3f7cdd69de 100644 --- a/docs/reference/functions/resolveLiveQueryValue.md +++ b/docs/reference/functions/resolveLiveQueryValue.md @@ -9,7 +9,7 @@ function resolveLiveQueryValue(value, __namedParameters): | null; ``` -Defined in: [packages/db/src/live-query-options.ts:346](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L346) +Defined in: [packages/db/src/live-query-options.ts:362](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L362) Resolve an adapter's query value to what its observer watches: `null` for a disabled query, an existing Collection with sync started, or a live query. diff --git a/docs/reference/functions/resumeDeferredLiveQueryCollections.md b/docs/reference/functions/resumeDeferredLiveQueryCollections.md index b506eee1b0..25b75ae74d 100644 --- a/docs/reference/functions/resumeDeferredLiveQueryCollections.md +++ b/docs/reference/functions/resumeDeferredLiveQueryCollections.md @@ -7,7 +7,7 @@ title: resumeDeferredLiveQueryCollections function resumeDeferredLiveQueryCollections(collections, reportSourceErrors): void; ``` -Defined in: [packages/db/src/live-query-options.ts:117](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L117) +Defined in: [packages/db/src/live-query-options.ts:118](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L118) Release every deferred source, then report the first startup failure. diff --git a/docs/reference/functions/toBoundaryError.md b/docs/reference/functions/toBoundaryError.md index ae9ecf397a..6343f4360f 100644 --- a/docs/reference/functions/toBoundaryError.md +++ b/docs/reference/functions/toBoundaryError.md @@ -7,7 +7,7 @@ title: toBoundaryError function toBoundaryError(cause): Error; ``` -Defined in: [packages/db/src/live-query-observer.ts:815](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L815) +Defined in: [packages/db/src/live-query-observer.ts:810](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L810) **`Internal`** diff --git a/docs/reference/functions/warnOnce.md b/docs/reference/functions/warnOnce.md deleted file mode 100644 index 58f5bffd8f..0000000000 --- a/docs/reference/functions/warnOnce.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -id: warnOnce -title: warnOnce ---- - -```ts -function warnOnce(key, message): void; -``` - -Defined in: [packages/db/src/utils.ts:434](https://github.com/TanStack/db/blob/main/packages/db/src/utils.ts#L434) - -**`Internal`** - -Log a warning message only once per unique key. -Subsequent calls with the same key will be silently ignored. - - Used by first-party collection adapters. - -## Parameters - -### key - -`string` - -Unique identifier for this warning - -### message - -`string` - -The warning message to display - -## Returns - -`void` - -## Example - -```typescript -// First call logs the warning -warnOnce('deprecated-api', 'This API is deprecated') - -// Subsequent calls with same key are ignored -warnOnce('deprecated-api', 'This API is deprecated') // silent -``` diff --git a/docs/reference/functions/withCollectionConfigFactory.md b/docs/reference/functions/withCollectionConfigFactory.md index 7008ab8232..1a716d4c7c 100644 --- a/docs/reference/functions/withCollectionConfigFactory.md +++ b/docs/reference/functions/withCollectionConfigFactory.md @@ -10,7 +10,7 @@ function withCollectionConfigFactory( claim?): CollectionConfigWithFactory; ``` -Defined in: [packages/db/src/client.ts:99](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L99) +Defined in: [packages/db/src/client.ts:106](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L106) Adds a fresh-config materializer to an adapter options object. diff --git a/docs/reference/index.md b/docs/reference/index.md index 2ff18dc75d..b921b3390f 100644 --- a/docs/reference/index.md +++ b/docs/reference/index.md @@ -34,7 +34,6 @@ title: "@tanstack/db" - [DeduplicatedLoadSubset](classes/DeduplicatedLoadSubset.md) - [DeleteKeyNotFoundError](classes/DeleteKeyNotFoundError.md) - [DistinctRequiresSelectError](classes/DistinctRequiresSelectError.md) -- [~~DuplicateAliasInSubqueryError~~](classes/DuplicateAliasInSubqueryError.md) - [DuplicateDbInstanceError](classes/DuplicateDbInstanceError.md) - [DuplicateKeyError](classes/DuplicateKeyError.md) - [DuplicateKeySyncError](classes/DuplicateKeySyncError.md) @@ -158,6 +157,7 @@ title: "@tanstack/db" - [EffectContext](interfaces/EffectContext.md) - [GroupKeys](interfaces/GroupKeys.md) - [HealthNode](interfaces/HealthNode.md) +- [HealthProblem](interfaces/HealthProblem.md) - [IndexDevModeConfig](interfaces/IndexDevModeConfig.md) - [IndexedDBCollectionConfig](interfaces/IndexedDBCollectionConfig.md) - [IndexedDBCollectionUtils](interfaces/IndexedDBCollectionUtils.md) @@ -348,6 +348,7 @@ title: "@tanstack/db" - [Query](variables/Query.md) - [SYNC\_PERSISTENCE\_PROTOCOL](variables/SYNC_PERSISTENCE_PROTOCOL.md) - [SYNC\_PERSISTENCE\_VERSION](variables/SYNC_PERSISTENCE_VERSION.md) +- [syncWriteNamesWholeRow](variables/syncWriteNamesWholeRow.md) ## Functions @@ -427,6 +428,7 @@ title: "@tanstack/db" - [isCollection](functions/isCollection.md) - [isCollectionOptions](functions/isCollectionOptions.md) - [isDevModeEnabled](functions/isDevModeEnabled.md) +- [isFailedStatus](functions/isFailedStatus.md) - [isNull](functions/isNull.md) - [isSingleResultCollection](functions/isSingleResultCollection.md) - [isUndefined](functions/isUndefined.md) @@ -457,7 +459,7 @@ title: "@tanstack/db" - [readLiveQueryWindowPageShape](functions/readLiveQueryWindowPageShape.md) - [rejectLiveQueryInput](functions/rejectLiveQueryInput.md) - [releaseDeferredOnReclaim](functions/releaseDeferredOnReclaim.md) -- [resetWarnings](functions/resetWarnings.md) +- [reportUncaught](functions/reportUncaught.md) - [resolveLiveQueryValue](functions/resolveLiveQueryValue.md) - [resumeDeferredLiveQueryCollections](functions/resumeDeferredLiveQueryCollections.md) - [safeRandomUUID](functions/safeRandomUUID.md) @@ -471,7 +473,6 @@ title: "@tanstack/db" - [upper](functions/upper.md) - [validateSyncPersistenceCapability](functions/validateSyncPersistenceCapability.md) - [walkExpression](functions/walkExpression.md) -- [warnOnce](functions/warnOnce.md) - [whenSyncAccepted](functions/whenSyncAccepted.md) - [withAcceptedReceipt](functions/withAcceptedReceipt.md) - [withArrayChangeTracking](functions/withArrayChangeTracking.md) diff --git a/docs/reference/interfaces/BaseCollectionConfig.md b/docs/reference/interfaces/BaseCollectionConfig.md index 77f7cf820f..dbc655fc18 100644 --- a/docs/reference/interfaces/BaseCollectionConfig.md +++ b/docs/reference/interfaces/BaseCollectionConfig.md @@ -3,7 +3,7 @@ id: BaseCollectionConfig title: BaseCollectionConfig --- -Defined in: [packages/db/src/types.ts:832](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L832) +Defined in: [packages/db/src/types.ts:875](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L875) ## Extended by @@ -29,10 +29,6 @@ Defined in: [packages/db/src/types.ts:832](https://github.com/TanStack/db/blob/m `TUtils` *extends* [`UtilsRecord`](../type-aliases/UtilsRecord.md) = [`UtilsRecord`](../type-aliases/UtilsRecord.md) -### TReturn - -`TReturn` = `any` - ## Properties ### autoIndex? @@ -41,7 +37,7 @@ Defined in: [packages/db/src/types.ts:832](https://github.com/TanStack/db/blob/m optional autoIndex: "eager" | "off"; ``` -Defined in: [packages/db/src/types.ts:886](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L886) +Defined in: [packages/db/src/types.ts:937](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L937) Auto-indexing mode for the collection. When enabled, indexes will be automatically created for simple where expressions. @@ -66,7 +62,7 @@ When enabled, indexes will be automatically created for simple where expressions optional compare: (x, y) => number; ``` -Defined in: [packages/db/src/types.ts:911](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L911) +Defined in: [packages/db/src/types.ts:962](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L962) Optional function to compare two items. This is used to order the items in the collection. @@ -106,7 +102,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime() optional defaultIndexType: IndexConstructor; ``` -Defined in: [packages/db/src/types.ts:900](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L900) +Defined in: [packages/db/src/types.ts:951](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L951) Default index type to use when creating indexes without an explicit type. Required for auto-indexing. Import from '@tanstack/db'. @@ -130,7 +126,7 @@ const collection = createCollection({ optional defaultStringCollation: StringCollationConfig; ``` -Defined in: [packages/db/src/types.ts:1106](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1106) +Defined in: [packages/db/src/types.ts:1137](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1137) Specifies how to compare data in the collection. This should be configured to match data ordering on the backend. @@ -145,13 +141,22 @@ E.g., when using the Electric DB collection these options optional gcTime: number; ``` -Defined in: [packages/db/src/types.ts:865](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L865) +Defined in: [packages/db/src/types.ts:916](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L916) Time in milliseconds after which the collection will be garbage collected when it has no active subscribers. Defaults to 5 minutes (300000ms). -Sync started without subscribers gets a minimum 50ms grace period. +Sync started without subscribers gets a minimum 50ms handoff grace period +until a subscriber attaches. After the last subscriber leaves, gcTime +applies without that startup minimum. Pending preloads retain the collection until they settle. Preloading ready -data refreshes the retention period. A non-positive or non-finite value +data refreshes the retention period. A persisting transaction that touches +the collection also retains it, and the period starts again when the last +one completes or fails, preserving any remaining startup grace. Pending +manual transactions do not retain it; keep a subscription for draft +visibility until commit or rollback. Rolling +back a manual transaction that stayed pending preserves the existing GC +deadline. Cleanup runs at a host idle opportunity after the delay. +A non-positive or non-finite value disables automatic garbage collection. *** @@ -162,7 +167,7 @@ disables automatic garbage collection. getKey: (item) => TKey; ``` -Defined in: [packages/db/src/types.ts:856](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L856) +Defined in: [packages/db/src/types.ts:898](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L898) Function to extract the ID from an object This is required for update/delete operations which now only accept IDs @@ -196,22 +201,19 @@ getKey: (item) => item.uuid optional id: string; ``` -Defined in: [packages/db/src/types.ts:845](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L845) +Defined in: [packages/db/src/types.ts:887](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L887) *** ### onDelete? ```ts -optional onDelete: - | DeleteMutationFn -| DeleteMutationFn; +optional onDelete: DeleteMutationFn; ``` -Defined in: [packages/db/src/types.ts:1095](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1095) +Defined in: [packages/db/src/types.ts:1129](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1129) Optional asynchronous handler function called before a delete operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -230,8 +232,6 @@ onDelete: async ({ transaction, collection }) => { await api.deleteTodos(keysToDelete) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -276,15 +276,12 @@ onDelete: async ({ transaction, collection }) => { ### onInsert? ```ts -optional onInsert: - | InsertMutationFn -| InsertMutationFn; +optional onInsert: InsertMutationFn; ``` -Defined in: [packages/db/src/types.ts:974](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L974) +Defined in: [packages/db/src/types.ts:1021](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1021) Optional asynchronous handler function called before an insert operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -303,8 +300,6 @@ onInsert: async ({ transaction, collection }) => { await api.createTodo(newItem) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -325,7 +320,6 @@ onInsert: async ({ transaction, collection }) => { await api.createTodos(items) // Refetch to get updated data from server await collection.utils.refetch() - return { refetch: false } } ``` @@ -347,15 +341,12 @@ onInsert: async ({ transaction, collection }) => { ### onUpdate? ```ts -optional onUpdate: - | UpdateMutationFn -| UpdateMutationFn; +optional onUpdate: UpdateMutationFn; ``` -Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) +Defined in: [packages/db/src/types.ts:1076](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1076) Optional asynchronous handler function called before an update operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -375,8 +366,6 @@ onUpdate: async ({ transaction, collection }) => { await api.updateTodo(mutation.original.id, changes) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -399,7 +388,6 @@ onUpdate: async ({ transaction, collection }) => { })) await api.updateTodos(updates) await collection.utils.refetch() - return { refetch: false } } ``` @@ -425,7 +413,7 @@ onUpdate: async ({ transaction, collection }) => { optional schema: TSchema; ``` -Defined in: [packages/db/src/types.ts:846](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L846) +Defined in: [packages/db/src/types.ts:888](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L888) *** @@ -435,7 +423,7 @@ Defined in: [packages/db/src/types.ts:846](https://github.com/TanStack/db/blob/m optional startSync: boolean; ``` -Defined in: [packages/db/src/types.ts:876](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L876) +Defined in: [packages/db/src/types.ts:927](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L927) Whether to eagerly start syncing on collection creation. When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches. @@ -458,7 +446,7 @@ false optional syncMode: SyncMode; ``` -Defined in: [packages/db/src/types.ts:920](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L920) +Defined in: [packages/db/src/types.ts:971](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L971) The mode of sync to use for the collection. @@ -480,4 +468,4 @@ The exact implementation of the sync mode is up to the sync implementation. optional utils: TUtils; ``` -Defined in: [packages/db/src/types.ts:1108](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1108) +Defined in: [packages/db/src/types.ts:1139](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1139) diff --git a/docs/reference/interfaces/ChangeMessage.md b/docs/reference/interfaces/ChangeMessage.md index 4fe7549fa3..40dca632b0 100644 --- a/docs/reference/interfaces/ChangeMessage.md +++ b/docs/reference/interfaces/ChangeMessage.md @@ -3,7 +3,7 @@ id: ChangeMessage title: ChangeMessage --- -Defined in: [packages/db/src/types.ts:620](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L620) +Defined in: [packages/db/src/types.ts:660](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L660) ## Type Parameters @@ -23,7 +23,7 @@ Defined in: [packages/db/src/types.ts:620](https://github.com/TanStack/db/blob/m key: TKey; ``` -Defined in: [packages/db/src/types.ts:624](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L624) +Defined in: [packages/db/src/types.ts:664](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L664) *** @@ -33,7 +33,7 @@ Defined in: [packages/db/src/types.ts:624](https://github.com/TanStack/db/blob/m optional metadata: Record; ``` -Defined in: [packages/db/src/types.ts:628](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L628) +Defined in: [packages/db/src/types.ts:668](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L668) *** @@ -43,7 +43,7 @@ Defined in: [packages/db/src/types.ts:628](https://github.com/TanStack/db/blob/m optional previousValue: T; ``` -Defined in: [packages/db/src/types.ts:626](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L626) +Defined in: [packages/db/src/types.ts:666](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L666) *** @@ -53,7 +53,7 @@ Defined in: [packages/db/src/types.ts:626](https://github.com/TanStack/db/blob/m type: OperationType; ``` -Defined in: [packages/db/src/types.ts:627](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L627) +Defined in: [packages/db/src/types.ts:667](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L667) *** @@ -63,4 +63,4 @@ Defined in: [packages/db/src/types.ts:627](https://github.com/TanStack/db/blob/m value: T; ``` -Defined in: [packages/db/src/types.ts:625](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L625) +Defined in: [packages/db/src/types.ts:665](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L665) diff --git a/docs/reference/interfaces/Collection.md b/docs/reference/interfaces/Collection.md index e5021651fc..4022cb2d30 100644 --- a/docs/reference/interfaces/Collection.md +++ b/docs/reference/interfaces/Collection.md @@ -234,7 +234,7 @@ Do not mutate the backing map or its rows: that bypasses publication. get compareOptions(): StringCollationConfig; ``` -Defined in: [packages/db/src/collection/index.ts:939](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L939) +Defined in: [packages/db/src/collection/index.ts:930](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L930) ##### Returns @@ -279,7 +279,7 @@ appear here and the rows stay. get indexes(): Map>; ``` -Defined in: [packages/db/src/collection/index.ts:924](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L924) +Defined in: [packages/db/src/collection/index.ts:915](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L915) Get resolved indexes for query optimization @@ -325,7 +325,7 @@ true if the collection has pending load more operations, false otherwise get size(): number; ``` -Defined in: [packages/db/src/collection/index.ts:789](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L789) +Defined in: [packages/db/src/collection/index.ts:780](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L780) Get the current size of the collection (cached) @@ -347,7 +347,7 @@ Get the current size of the collection (cached) get state(): Map>; ``` -Defined in: [packages/db/src/collection/index.ts:1116](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1116) +Defined in: [packages/db/src/collection/index.ts:1107](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1107) Gets the current state of the collection as a Map @@ -432,7 +432,7 @@ query that has no subscriber or preload of its own does not count. get subscribers(): readonly CollectionDependent[]; ``` -Defined in: [packages/db/src/collection/index.ts:1324](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1324) +Defined in: [packages/db/src/collection/index.ts:1317](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1317) Live queries, Effects, and direct subscriptions that read this Collection. `cleanup()` refuses while a live query or Effect reads it. @@ -455,7 +455,7 @@ readonly [`CollectionDependent`](CollectionDependent.md)[] get toArray(): WithVirtualProps[]; ``` -Defined in: [packages/db/src/collection/index.ts:1140](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1140) +Defined in: [packages/db/src/collection/index.ts:1131](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1131) Gets the current state of the collection as an Array @@ -539,7 +539,7 @@ A Collection this one depends on changed its health tree. _hasHeldSyncTransaction(): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:782](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L782) +Defined in: [packages/db/src/collection/index.ts:773](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L773) Whether an accepted sync transaction is not yet visible. @@ -585,7 +585,7 @@ Defined in: [packages/db/src/collection/index.ts:681](https://github.com/TanStac _hasOptimisticOverlay(key): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:774](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L774) +Defined in: [packages/db/src/collection/index.ts:765](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L765) Whether a local write obscures this key's authoritative source row. @@ -745,7 +745,7 @@ Listen for the first subscriber or preload in this sync run. _optimisticOverlaySize(): number; ``` -Defined in: [packages/db/src/collection/index.ts:767](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L767) +Defined in: [packages/db/src/collection/index.ts:758](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L758) Maximum number of source rows whose visible projection a local write can hide. @@ -837,35 +837,13 @@ Subscribe to layout-only publications. Internal observer channel. *** -### \_syncedRowMetadataKeysOutsideBase() - -```ts -_syncedRowMetadataKeysOutsideBase(): TKey[]; -``` - -Defined in: [packages/db/src/collection/index.ts:744](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L744) - -**`Internal`** - -Applied metadata keys without a source row. - -#### Returns - -`TKey`[] - -#### Inherited from - -[`CollectionImpl`](../classes/CollectionImpl.md).[`_syncedRowMetadataKeysOutsideBase`](../classes/CollectionImpl.md#_syncedrowmetadatakeysoutsidebase) - -*** - ### \[iterator\]() ```ts iterator: IterableIterator<[TKey, WithVirtualProps]>; ``` -Defined in: [packages/db/src/collection/index.ts:827](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L827) +Defined in: [packages/db/src/collection/index.ts:818](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L818) Get all entries (virtual derived state) @@ -885,7 +863,7 @@ Get all entries (virtual derived state) cleanup(options?): Promise; ``` -Defined in: [packages/db/src/collection/index.ts:1358](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1358) +Defined in: [packages/db/src/collection/index.ts:1351](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1351) Clean up the collection by stopping sync and clearing data This can be called manually or automatically by garbage collection @@ -926,7 +904,7 @@ cleanup and asks for data again when a new sync run starts. createIndex(indexCallback, config): BaseIndex; ``` -Defined in: [packages/db/src/collection/index.ts:893](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L893) +Defined in: [packages/db/src/collection/index.ts:884](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L884) Creates an index on a collection for faster queries. Indexes significantly improve query performance by allowing constant time lookups @@ -986,7 +964,7 @@ currentStateAsChanges(options): | ChangeMessage, TKey>[]; ``` -Defined in: [packages/db/src/collection/index.ts:1173](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1173) +Defined in: [packages/db/src/collection/index.ts:1164](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1164) Returns the current state of the collection as an array of changes @@ -1034,7 +1012,7 @@ const activeChanges = collection.currentStateAsChanges({ delete(keys, config?): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1093](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1093) +Defined in: [packages/db/src/collection/index.ts:1084](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1084) Deletes one or more items from the collection @@ -1101,7 +1079,7 @@ try { entries(): IterableIterator<[TKey, WithVirtualProps]>; ``` -Defined in: [packages/db/src/collection/index.ts:815](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L815) +Defined in: [packages/db/src/collection/index.ts:806](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L806) Get all entries (virtual derived state) @@ -1121,7 +1099,7 @@ Get all entries (virtual derived state) forEach(callbackfn): void; ``` -Defined in: [packages/db/src/collection/index.ts:836](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L836) +Defined in: [packages/db/src/collection/index.ts:827](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L827) Execute a callback for each entry in the collection @@ -1149,7 +1127,7 @@ get(key): | undefined; ``` -Defined in: [packages/db/src/collection/index.ts:755](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L755) +Defined in: [packages/db/src/collection/index.ts:746](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L746) Get the current value for a key (virtual derived state) @@ -1176,7 +1154,7 @@ Get the current value for a key (virtual derived state) getIndexMetadata(): CollectionIndexMetadata[]; ``` -Defined in: [packages/db/src/collection/index.ts:917](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L917) +Defined in: [packages/db/src/collection/index.ts:908](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L908) Returns a snapshot of current index metadata sorted by indexId. Persistence wrappers can use this to bootstrap index state if indexes were @@ -1198,7 +1176,7 @@ created before event listeners were attached. getKeyFromItem(item): TKey; ``` -Defined in: [packages/db/src/collection/index.ts:867](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L867) +Defined in: [packages/db/src/collection/index.ts:858](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L858) #### Parameters @@ -1222,7 +1200,7 @@ Defined in: [packages/db/src/collection/index.ts:867](https://github.com/TanStac has(key): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:762](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L762) +Defined in: [packages/db/src/collection/index.ts:753](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L753) Check if a key exists in the collection (virtual derived state) @@ -1250,7 +1228,7 @@ insert(data, config?): | Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:980](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L980) +Defined in: [packages/db/src/collection/index.ts:971](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L971) Inserts one or more items into the collection @@ -1359,7 +1337,7 @@ if (collection.isReady()) { keys(): IterableIterator; ``` -Defined in: [packages/db/src/collection/index.ts:796](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L796) +Defined in: [packages/db/src/collection/index.ts:787](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L787) Get all keys (virtual derived state) @@ -1379,7 +1357,7 @@ Get all keys (virtual derived state) map(callbackfn): U[]; ``` -Defined in: [packages/db/src/collection/index.ts:852](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L852) +Defined in: [packages/db/src/collection/index.ts:843](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L843) Create a new array with the results of calling a function for each entry in the collection @@ -1411,7 +1389,7 @@ Create a new array with the results of calling a function for each entry in the off(event, callback): void; ``` -Defined in: [packages/db/src/collection/index.ts:1284](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1284) +Defined in: [packages/db/src/collection/index.ts:1275](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1275) Unsubscribe from a collection event @@ -1461,7 +1439,7 @@ Unsubscribe from a collection event on(event, callback): () => void; ``` -Defined in: [packages/db/src/collection/index.ts:1264](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1264) +Defined in: [packages/db/src/collection/index.ts:1255](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1255) Subscribe to a collection event @@ -1517,7 +1495,7 @@ Subscribe to a collection event once(event, callback): () => void; ``` -Defined in: [packages/db/src/collection/index.ts:1274](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1274) +Defined in: [packages/db/src/collection/index.ts:1265](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1265) Subscribe to a collection event once @@ -1643,14 +1621,16 @@ Multiple concurrent calls will share the same promise reload(): Promise; ``` -Defined in: [packages/db/src/collection/index.ts:1315](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1315) +Defined in: [packages/db/src/collection/index.ts:1308](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1308) Start a new sync run while everything visible stays: the rows, the status, and the current error, with `reloading` on this Collection's -health node. The new run's first commit replaces the rows at once and -clears the node's problem; a `status` of `error` becomes `ready`. If the -new run fails first, the rows and status stay and the node shows the new -error. On a live query, it reloads each of its sources that has an +health node. The new run's writes apply on the kept rows; its snapshot +(`begin({ snapshot: true })`) or truncate replaces them at once. The +reload completes when that replacement applies, or at the new run's +`markReady()`, and the node drops the old run's problems; a `status` of +`error` becomes `ready` at `markReady()`. If the new run fails first, the +rows and status stay and the node shows the new error. On a live query, it reloads each of its sources that has an `error`, and then the query itself if its own node has an `error`: a failed first load or a failed request for more data. @@ -1674,7 +1654,7 @@ Collection up with its dependents to start it fresh. removeIndex(indexOrId): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:908](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L908) +Defined in: [packages/db/src/collection/index.ts:899](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L899) Removes an index created with createIndex. Returns true when an index existed and was removed. @@ -1727,7 +1707,7 @@ Throws during active cleanup; restart after cleanup completes instead. stateWhenReady(): Promise>>; ``` -Defined in: [packages/db/src/collection/index.ts:1131](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1131) +Defined in: [packages/db/src/collection/index.ts:1122](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1122) Gets the current state of the collection as a Map once the collection is ready Resolves when `preload()` does. For a live query, that is initial-query @@ -1753,7 +1733,7 @@ Promise that resolves to a Map containing all items in the collection subscribeChanges(callback, options?): CollectionSubscription; ``` -Defined in: [packages/db/src/collection/index.ts:1227](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1227) +Defined in: [packages/db/src/collection/index.ts:1218](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1218) Subscribe to changes in the collection Ordinary subscriptions throw during active cleanup. Wait for cleanup() @@ -1834,7 +1814,7 @@ const subscription = collection.subscribeChanges((changes) => { subscribeChanges(callback, options?): CollectionSubscription; ``` -Defined in: [packages/db/src/collection/index.ts:1235](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1235) +Defined in: [packages/db/src/collection/index.ts:1226](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1226) Subscribe to changes in the collection Ordinary subscriptions throw during active cleanup. Wait for cleanup() @@ -1917,7 +1897,7 @@ const subscription = collection.subscribeChanges((changes) => { toArrayWhenReady(): Promise[]>; ``` -Defined in: [packages/db/src/collection/index.ts:1151](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1151) +Defined in: [packages/db/src/collection/index.ts:1142](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1142) Gets the current state of the collection as an Array once the collection is ready Resolves when `preload()` does. For a live query, that is initial-query @@ -1943,7 +1923,7 @@ Promise that resolves to an Array containing all items in the collection update(key, callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1025](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1025) +Defined in: [packages/db/src/collection/index.ts:1016](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1016) Updates one or more items in the collection using a callback function @@ -2018,7 +1998,7 @@ update( callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1031](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1031) +Defined in: [packages/db/src/collection/index.ts:1022](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1022) Updates one or more items in the collection using a callback function @@ -2096,7 +2076,7 @@ try { update(id, callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1038](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1038) +Defined in: [packages/db/src/collection/index.ts:1029](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1029) Updates one or more items in the collection using a callback function @@ -2171,7 +2151,7 @@ update( callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1044](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1044) +Defined in: [packages/db/src/collection/index.ts:1035](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1035) Updates one or more items in the collection using a callback function @@ -2252,7 +2232,7 @@ validateData( key?): T; ``` -Defined in: [packages/db/src/collection/index.ts:931](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L931) +Defined in: [packages/db/src/collection/index.ts:922](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L922) Validates the data against the schema @@ -2286,7 +2266,7 @@ Validates the data against the schema values(): IterableIterator>; ``` -Defined in: [packages/db/src/collection/index.ts:803](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L803) +Defined in: [packages/db/src/collection/index.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L794) Get all values (virtual derived state) @@ -2306,7 +2286,7 @@ Get all values (virtual derived state) waitFor(event, timeout?): Promise; ``` -Defined in: [packages/db/src/collection/index.ts:1294](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1294) +Defined in: [packages/db/src/collection/index.ts:1285](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1285) Wait for a collection event diff --git a/docs/reference/interfaces/CollectionConfig.md b/docs/reference/interfaces/CollectionConfig.md index 8becfdb706..82572ac37d 100644 --- a/docs/reference/interfaces/CollectionConfig.md +++ b/docs/reference/interfaces/CollectionConfig.md @@ -3,7 +3,7 @@ id: CollectionConfig title: CollectionConfig --- -Defined in: [packages/db/src/types.ts:1111](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1111) +Defined in: [packages/db/src/types.ts:1142](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1142) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/db/src/types.ts:1111](https://github.com/TanStack/db/blob/ optional autoIndex: "eager" | "off"; ``` -Defined in: [packages/db/src/types.ts:886](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L886) +Defined in: [packages/db/src/types.ts:937](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L937) Auto-indexing mode for the collection. When enabled, indexes will be automatically created for simple where expressions. @@ -64,7 +64,7 @@ When enabled, indexes will be automatically created for simple where expressions optional compare: (x, y) => number; ``` -Defined in: [packages/db/src/types.ts:911](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L911) +Defined in: [packages/db/src/types.ts:962](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L962) Optional function to compare two items. This is used to order the items in the collection. @@ -108,7 +108,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime() optional defaultIndexType: IndexConstructor; ``` -Defined in: [packages/db/src/types.ts:900](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L900) +Defined in: [packages/db/src/types.ts:951](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L951) Default index type to use when creating indexes without an explicit type. Required for auto-indexing. Import from '@tanstack/db'. @@ -136,7 +136,7 @@ const collection = createCollection({ optional defaultStringCollation: StringCollationConfig; ``` -Defined in: [packages/db/src/types.ts:1106](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1106) +Defined in: [packages/db/src/types.ts:1137](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1137) Specifies how to compare data in the collection. This should be configured to match data ordering on the backend. @@ -155,13 +155,22 @@ E.g., when using the Electric DB collection these options optional gcTime: number; ``` -Defined in: [packages/db/src/types.ts:865](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L865) +Defined in: [packages/db/src/types.ts:916](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L916) Time in milliseconds after which the collection will be garbage collected when it has no active subscribers. Defaults to 5 minutes (300000ms). -Sync started without subscribers gets a minimum 50ms grace period. +Sync started without subscribers gets a minimum 50ms handoff grace period +until a subscriber attaches. After the last subscriber leaves, gcTime +applies without that startup minimum. Pending preloads retain the collection until they settle. Preloading ready -data refreshes the retention period. A non-positive or non-finite value +data refreshes the retention period. A persisting transaction that touches +the collection also retains it, and the period starts again when the last +one completes or fails, preserving any remaining startup grace. Pending +manual transactions do not retain it; keep a subscription for draft +visibility until commit or rollback. Rolling +back a manual transaction that stayed pending preserves the existing GC +deadline. Cleanup runs at a host idle opportunity after the delay. +A non-positive or non-finite value disables automatic garbage collection. #### Inherited from @@ -176,7 +185,7 @@ disables automatic garbage collection. getKey: (item) => TKey; ``` -Defined in: [packages/db/src/types.ts:856](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L856) +Defined in: [packages/db/src/types.ts:898](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L898) Function to extract the ID from an object This is required for update/delete operations which now only accept IDs @@ -214,7 +223,7 @@ getKey: (item) => item.uuid optional id: string; ``` -Defined in: [packages/db/src/types.ts:845](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L845) +Defined in: [packages/db/src/types.ts:887](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L887) #### Inherited from @@ -225,15 +234,12 @@ Defined in: [packages/db/src/types.ts:845](https://github.com/TanStack/db/blob/m ### onDelete? ```ts -optional onDelete: - | DeleteMutationFn -| DeleteMutationFn; +optional onDelete: DeleteMutationFn; ``` -Defined in: [packages/db/src/types.ts:1095](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1095) +Defined in: [packages/db/src/types.ts:1129](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1129) Optional asynchronous handler function called before a delete operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -252,8 +258,6 @@ onDelete: async ({ transaction, collection }) => { await api.deleteTodos(keysToDelete) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -302,15 +306,12 @@ onDelete: async ({ transaction, collection }) => { ### onInsert? ```ts -optional onInsert: - | InsertMutationFn -| InsertMutationFn; +optional onInsert: InsertMutationFn; ``` -Defined in: [packages/db/src/types.ts:974](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L974) +Defined in: [packages/db/src/types.ts:1021](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1021) Optional asynchronous handler function called before an insert operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -329,8 +330,6 @@ onInsert: async ({ transaction, collection }) => { await api.createTodo(newItem) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -351,7 +350,6 @@ onInsert: async ({ transaction, collection }) => { await api.createTodos(items) // Refetch to get updated data from server await collection.utils.refetch() - return { refetch: false } } ``` @@ -377,15 +375,12 @@ onInsert: async ({ transaction, collection }) => { ### onUpdate? ```ts -optional onUpdate: - | UpdateMutationFn -| UpdateMutationFn; +optional onUpdate: UpdateMutationFn; ``` -Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) +Defined in: [packages/db/src/types.ts:1076](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1076) Optional asynchronous handler function called before an update operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -405,8 +400,6 @@ onUpdate: async ({ transaction, collection }) => { await api.updateTodo(mutation.original.id, changes) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -429,7 +422,6 @@ onUpdate: async ({ transaction, collection }) => { })) await api.updateTodos(updates) await collection.utils.refetch() - return { refetch: false } } ``` @@ -459,7 +451,7 @@ onUpdate: async ({ transaction, collection }) => { optional schema: TSchema; ``` -Defined in: [packages/db/src/types.ts:846](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L846) +Defined in: [packages/db/src/types.ts:888](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L888) #### Inherited from @@ -473,7 +465,7 @@ Defined in: [packages/db/src/types.ts:846](https://github.com/TanStack/db/blob/m optional startSync: boolean; ``` -Defined in: [packages/db/src/types.ts:876](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L876) +Defined in: [packages/db/src/types.ts:927](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L927) Whether to eagerly start syncing on collection creation. When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches. @@ -500,7 +492,7 @@ false sync: SyncConfig; ``` -Defined in: [packages/db/src/types.ts:1117](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1117) +Defined in: [packages/db/src/types.ts:1148](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1148) *** @@ -510,7 +502,7 @@ Defined in: [packages/db/src/types.ts:1117](https://github.com/TanStack/db/blob/ optional syncMode: SyncMode; ``` -Defined in: [packages/db/src/types.ts:920](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L920) +Defined in: [packages/db/src/types.ts:971](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L971) The mode of sync to use for the collection. @@ -536,7 +528,7 @@ The exact implementation of the sync mode is up to the sync implementation. optional utils: TUtils; ``` -Defined in: [packages/db/src/types.ts:1108](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1108) +Defined in: [packages/db/src/types.ts:1139](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1139) #### Inherited from diff --git a/docs/reference/interfaces/CollectionDependent.md b/docs/reference/interfaces/CollectionDependent.md index 1e2935415b..dbfc49628b 100644 --- a/docs/reference/interfaces/CollectionDependent.md +++ b/docs/reference/interfaces/CollectionDependent.md @@ -3,7 +3,7 @@ id: CollectionDependent title: CollectionDependent --- -Defined in: [packages/db/src/types.ts:1187](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1187) +Defined in: [packages/db/src/types.ts:1218](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1218) Something that reads a Collection, as listed by `collection.subscribers`: a live query, an Effect, or a direct subscription. @@ -16,7 +16,7 @@ a live query, an Effect, or a direct subscription. readonly active: boolean; ``` -Defined in: [packages/db/src/types.ts:1196](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1196) +Defined in: [packages/db/src/types.ts:1227](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1227) Whether something still reads through this dependent: an Effect or a subscription always does; a live query does while it has a subscriber. @@ -30,7 +30,7 @@ subscription always does; a live query does while it has a subscriber. readonly optional collection: Collection; ``` -Defined in: [packages/db/src/types.ts:1190](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1190) +Defined in: [packages/db/src/types.ts:1221](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1221) A live query's Collection; a pooled live query has none. @@ -42,7 +42,7 @@ A live query's Collection; a pooled live query has none. end: () => Promise; ``` -Defined in: [packages/db/src/types.ts:1201](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1201) +Defined in: [packages/db/src/types.ts:1232](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1232) End this dependent: clean up the live query with its own dependents, dispose the Effect, or end the subscription. @@ -59,4 +59,4 @@ dispose the Effect, or end the subscription. readonly kind: "live-query" | "effect" | "subscription"; ``` -Defined in: [packages/db/src/types.ts:1188](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1188) +Defined in: [packages/db/src/types.ts:1219](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1219) diff --git a/docs/reference/interfaces/CollectionErrorInfo.md b/docs/reference/interfaces/CollectionErrorInfo.md index ce7e737b24..ef63a69c8f 100644 --- a/docs/reference/interfaces/CollectionErrorInfo.md +++ b/docs/reference/interfaces/CollectionErrorInfo.md @@ -3,12 +3,16 @@ id: CollectionErrorInfo title: CollectionErrorInfo --- -Defined in: [packages/db/src/types.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L794) +Defined in: [packages/db/src/types.ts:822](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L822) Detail about a Collection problem. Every field except `cause` is plain data, so the value can be logged or sent as JSON; `cause` keeps the original value and is omitted from JSON. +## Extended by + +- [`HealthProblem`](HealthProblem.md) + ## Properties ### at @@ -17,7 +21,7 @@ and is omitted from JSON. readonly at: number; ``` -Defined in: [packages/db/src/types.ts:799](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L799) +Defined in: [packages/db/src/types.ts:827](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L827) Epoch milliseconds when the problem was reported. @@ -29,7 +33,7 @@ Epoch milliseconds when the problem was reported. readonly cause: unknown; ``` -Defined in: [packages/db/src/types.ts:800](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L800) +Defined in: [packages/db/src/types.ts:828](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L828) *** @@ -39,7 +43,7 @@ Defined in: [packages/db/src/types.ts:800](https://github.com/TanStack/db/blob/m readonly optional code: string; ``` -Defined in: [packages/db/src/types.ts:797](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L797) +Defined in: [packages/db/src/types.ts:825](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L825) *** @@ -49,7 +53,7 @@ Defined in: [packages/db/src/types.ts:797](https://github.com/TanStack/db/blob/m readonly message: string; ``` -Defined in: [packages/db/src/types.ts:796](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L796) +Defined in: [packages/db/src/types.ts:824](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L824) *** @@ -59,4 +63,4 @@ Defined in: [packages/db/src/types.ts:796](https://github.com/TanStack/db/blob/m readonly name: string; ``` -Defined in: [packages/db/src/types.ts:795](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L795) +Defined in: [packages/db/src/types.ts:823](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L823) diff --git a/docs/reference/interfaces/CollectionLike.md b/docs/reference/interfaces/CollectionLike.md index f2ebe0046a..7046b213bc 100644 --- a/docs/reference/interfaces/CollectionLike.md +++ b/docs/reference/interfaces/CollectionLike.md @@ -30,7 +30,7 @@ for the change events system to work compareOptions: StringCollationConfig; ``` -Defined in: [packages/db/src/collection/index.ts:939](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L939) +Defined in: [packages/db/src/collection/index.ts:930](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L930) #### Inherited from @@ -58,7 +58,7 @@ Defined in: [packages/db/src/collection/index.ts:407](https://github.com/TanStac indexes: Map>; ``` -Defined in: [packages/db/src/collection/index.ts:924](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L924) +Defined in: [packages/db/src/collection/index.ts:915](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L915) #### Inherited from @@ -74,7 +74,7 @@ Pick.indexes entries(): IterableIterator<[TKey, WithVirtualProps]>; ``` -Defined in: [packages/db/src/collection/index.ts:815](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L815) +Defined in: [packages/db/src/collection/index.ts:806](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L806) Get all entries (virtual derived state) @@ -98,7 +98,7 @@ get(key): | undefined; ``` -Defined in: [packages/db/src/collection/index.ts:755](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L755) +Defined in: [packages/db/src/collection/index.ts:746](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L746) Get the current value for a key (virtual derived state) @@ -127,7 +127,7 @@ Pick.get has(key): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:762](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L762) +Defined in: [packages/db/src/collection/index.ts:753](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L753) Check if a key exists in the collection (virtual derived state) diff --git a/docs/reference/interfaces/Context.md b/docs/reference/interfaces/Context.md index 7c5bb19145..89aac753de 100644 --- a/docs/reference/interfaces/Context.md +++ b/docs/reference/interfaces/Context.md @@ -3,7 +3,7 @@ id: Context title: Context --- -Defined in: [packages/db/src/query/builder/types.ts:48](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L48) +Defined in: [packages/db/src/query/builder/types.ts:45](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L45) Context - The central state container for query builder operations @@ -35,7 +35,7 @@ The context evolves through the query builder chain: baseSchema: ContextSchema; ``` -Defined in: [packages/db/src/query/builder/types.ts:50](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L50) +Defined in: [packages/db/src/query/builder/types.ts:47](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L47) *** @@ -45,7 +45,7 @@ Defined in: [packages/db/src/query/builder/types.ts:50](https://github.com/TanSt fromSourceName: string; ``` -Defined in: [packages/db/src/query/builder/types.ts:56](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L56) +Defined in: [packages/db/src/query/builder/types.ts:53](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L53) *** @@ -55,7 +55,7 @@ Defined in: [packages/db/src/query/builder/types.ts:56](https://github.com/TanSt optional fromSourceNames: readonly string[]; ``` -Defined in: [packages/db/src/query/builder/types.ts:58](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L58) +Defined in: [packages/db/src/query/builder/types.ts:55](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L55) *** @@ -65,7 +65,7 @@ Defined in: [packages/db/src/query/builder/types.ts:58](https://github.com/TanSt optional hasJoins: boolean; ``` -Defined in: [packages/db/src/query/builder/types.ts:62](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L62) +Defined in: [packages/db/src/query/builder/types.ts:59](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L59) *** @@ -75,7 +75,7 @@ Defined in: [packages/db/src/query/builder/types.ts:62](https://github.com/TanSt optional hasResult: true; ``` -Defined in: [packages/db/src/query/builder/types.ts:71](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L71) +Defined in: [packages/db/src/query/builder/types.ts:68](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L68) *** @@ -85,7 +85,7 @@ Defined in: [packages/db/src/query/builder/types.ts:71](https://github.com/TanSt optional hasUnionFrom: true; ``` -Defined in: [packages/db/src/query/builder/types.ts:60](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L60) +Defined in: [packages/db/src/query/builder/types.ts:57](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L57) *** @@ -95,7 +95,7 @@ Defined in: [packages/db/src/query/builder/types.ts:60](https://github.com/TanSt optional joinTypes: Record; ``` -Defined in: [packages/db/src/query/builder/types.ts:64](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L64) +Defined in: [packages/db/src/query/builder/types.ts:61](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L61) *** @@ -105,7 +105,7 @@ Defined in: [packages/db/src/query/builder/types.ts:64](https://github.com/TanSt optional refsSchema: ContextSchema; ``` -Defined in: [packages/db/src/query/builder/types.ts:54](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L54) +Defined in: [packages/db/src/query/builder/types.ts:51](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L51) *** @@ -115,7 +115,7 @@ Defined in: [packages/db/src/query/builder/types.ts:54](https://github.com/TanSt optional result: any; ``` -Defined in: [packages/db/src/query/builder/types.ts:69](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L69) +Defined in: [packages/db/src/query/builder/types.ts:66](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L66) *** @@ -125,7 +125,7 @@ Defined in: [packages/db/src/query/builder/types.ts:69](https://github.com/TanSt schema: ContextSchema; ``` -Defined in: [packages/db/src/query/builder/types.ts:52](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L52) +Defined in: [packages/db/src/query/builder/types.ts:49](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L49) *** @@ -135,4 +135,4 @@ Defined in: [packages/db/src/query/builder/types.ts:52](https://github.com/TanSt optional singleResult: boolean; ``` -Defined in: [packages/db/src/query/builder/types.ts:73](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L73) +Defined in: [packages/db/src/query/builder/types.ts:70](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L70) diff --git a/docs/reference/interfaces/CreateLiveQueryObserverOptions.md b/docs/reference/interfaces/CreateLiveQueryObserverOptions.md index 524c426697..191ad0d950 100644 --- a/docs/reference/interfaces/CreateLiveQueryObserverOptions.md +++ b/docs/reference/interfaces/CreateLiveQueryObserverOptions.md @@ -3,7 +3,7 @@ id: CreateLiveQueryObserverOptions title: CreateLiveQueryObserverOptions --- -Defined in: [packages/db/src/live-query-observer.ts:781](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L781) +Defined in: [packages/db/src/live-query-observer.ts:776](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L776) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/db/src/live-query-observer.ts:781](https://github.com/TanS optional client: DbClient; ``` -Defined in: [packages/db/src/live-query-observer.ts:798](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L798) +Defined in: [packages/db/src/live-query-observer.ts:793](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L793) DbClient cache that owns SSR snapshots for this query identity. @@ -25,7 +25,7 @@ DbClient cache that owns SSR snapshots for this query identity. optional mode: "granular" | "wholesale"; ``` -Defined in: [packages/db/src/live-query-observer.ts:796](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L796) +Defined in: [packages/db/src/live-query-observer.ts:791](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L791) How subscribers consume the observer: @@ -48,7 +48,7 @@ How subscribers consume the observer: optional onPreload: () => void; ``` -Defined in: [packages/db/src/live-query-observer.ts:802](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L802) +Defined in: [packages/db/src/live-query-observer.ts:797](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L797) Resume framework-deferred query sources before a server preload. @@ -64,7 +64,7 @@ Resume framework-deferred query sources before a server preload. optional queryHash: string; ``` -Defined in: [packages/db/src/live-query-observer.ts:800](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L800) +Defined in: [packages/db/src/live-query-observer.ts:795](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L795) Stable live-query identity used for dehydration and hydration. @@ -76,6 +76,6 @@ Stable live-query identity used for dehydration and hydration. optional suspendUntilReady: boolean; ``` -Defined in: [packages/db/src/live-query-observer.ts:804](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L804) +Defined in: [packages/db/src/live-query-observer.ts:799](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L799) Read the completed stream rather than an earlier ordinary loading view. diff --git a/docs/reference/interfaces/CreateLiveQueryWindowControllerOptions.md b/docs/reference/interfaces/CreateLiveQueryWindowControllerOptions.md index 4668e32c18..3c2619fddd 100644 --- a/docs/reference/interfaces/CreateLiveQueryWindowControllerOptions.md +++ b/docs/reference/interfaces/CreateLiveQueryWindowControllerOptions.md @@ -3,7 +3,7 @@ id: CreateLiveQueryWindowControllerOptions title: CreateLiveQueryWindowControllerOptions --- -Defined in: [packages/db/src/live-query-window-controller.ts:540](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L540) +Defined in: [packages/db/src/live-query-window-controller.ts:543](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L543) **`Internal`** @@ -17,7 +17,7 @@ This contract is unstable while RFC #1623 is being implemented. optional client: DbClient; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:541](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L541) +Defined in: [packages/db/src/live-query-window-controller.ts:544](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L544) *** @@ -27,7 +27,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:541](https://github optional initialPageCount: number; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:548](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L548) +Defined in: [packages/db/src/live-query-window-controller.ts:551](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L551) Committed pages to preserve when a framework binding changes page shape. @@ -39,7 +39,7 @@ Committed pages to preserve when a framework binding changes page shape. optional initialPageParam: number; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:546](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L546) +Defined in: [packages/db/src/live-query-window-controller.ts:549](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L549) Value of the first page's `pageParam` (default 0). @@ -51,7 +51,7 @@ Value of the first page's `pageParam` (default 0). optional pageSize: number; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:544](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L544) +Defined in: [packages/db/src/live-query-window-controller.ts:547](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L547) Rows per page (default 20). Invalid values use the default. @@ -63,4 +63,4 @@ Rows per page (default 20). Invalid values use the default. optional queryHash: string; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:542](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L542) +Defined in: [packages/db/src/live-query-window-controller.ts:545](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L545) diff --git a/docs/reference/interfaces/CurrentStateAsChangesOptions.md b/docs/reference/interfaces/CurrentStateAsChangesOptions.md index f128e173f4..02857eec9a 100644 --- a/docs/reference/interfaces/CurrentStateAsChangesOptions.md +++ b/docs/reference/interfaces/CurrentStateAsChangesOptions.md @@ -3,7 +3,7 @@ id: CurrentStateAsChangesOptions title: CurrentStateAsChangesOptions --- -Defined in: [packages/db/src/types.ts:1291](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1291) +Defined in: [packages/db/src/types.ts:1326](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1326) Options for getting current state as changes @@ -15,7 +15,7 @@ Options for getting current state as changes optional limit: number; ``` -Defined in: [packages/db/src/types.ts:1295](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1295) +Defined in: [packages/db/src/types.ts:1330](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1330) *** @@ -25,7 +25,7 @@ Defined in: [packages/db/src/types.ts:1295](https://github.com/TanStack/db/blob/ optional optimizedOnly: boolean; ``` -Defined in: [packages/db/src/types.ts:1296](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1296) +Defined in: [packages/db/src/types.ts:1331](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1331) *** @@ -35,7 +35,7 @@ Defined in: [packages/db/src/types.ts:1296](https://github.com/TanStack/db/blob/ optional orderBy: OrderBy; ``` -Defined in: [packages/db/src/types.ts:1294](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1294) +Defined in: [packages/db/src/types.ts:1329](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1329) *** @@ -45,6 +45,6 @@ Defined in: [packages/db/src/types.ts:1294](https://github.com/TanStack/db/blob/ optional where: BasicExpression; ``` -Defined in: [packages/db/src/types.ts:1293](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1293) +Defined in: [packages/db/src/types.ts:1328](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1328) Pre-compiled expression for filtering the current state diff --git a/docs/reference/interfaces/Effect.md b/docs/reference/interfaces/Effect.md index 79bac18643..fdf5358d00 100644 --- a/docs/reference/interfaces/Effect.md +++ b/docs/reference/interfaces/Effect.md @@ -3,7 +3,7 @@ id: Effect title: Effect --- -Defined in: [packages/db/src/query/effect.ts:164](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L164) +Defined in: [packages/db/src/query/effect.ts:165](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L165) Handle returned by createEffect @@ -15,7 +15,7 @@ Handle returned by createEffect dispose: () => Promise; ``` -Defined in: [packages/db/src/query/effect.ts:169](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L169) +Defined in: [packages/db/src/query/effect.ts:170](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L170) Dispose the effect and await in-flight handlers. Calls during one cleanup attempt, including calls from abort/release callbacks, share its outcome. @@ -32,6 +32,6 @@ attempt, including calls from abort/release callbacks, share its outcome. readonly disposed: boolean; ``` -Defined in: [packages/db/src/query/effect.ts:171](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L171) +Defined in: [packages/db/src/query/effect.ts:172](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L172) Whether this effect has been disposed diff --git a/docs/reference/interfaces/EffectConfig.md b/docs/reference/interfaces/EffectConfig.md index de7d419641..a46829a1e2 100644 --- a/docs/reference/interfaces/EffectConfig.md +++ b/docs/reference/interfaces/EffectConfig.md @@ -3,7 +3,7 @@ id: EffectConfig title: EffectConfig --- -Defined in: [packages/db/src/query/effect.ts:112](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L112) +Defined in: [packages/db/src/query/effect.ts:113](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L113) Effect configuration @@ -25,7 +25,7 @@ Effect configuration optional id: string; ``` -Defined in: [packages/db/src/query/effect.ts:117](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L117) +Defined in: [packages/db/src/query/effect.ts:118](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L118) Optional ID for debugging/tracing @@ -37,7 +37,7 @@ Optional ID for debugging/tracing optional onBatch: EffectBatchHandler; ``` -Defined in: [packages/db/src/query/effect.ts:132](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L132) +Defined in: [packages/db/src/query/effect.ts:133](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L133) Called once per graph run with all delta events from that batch @@ -49,7 +49,7 @@ Called once per graph run with all delta events from that batch optional onEnter: EffectEventHandler; ``` -Defined in: [packages/db/src/query/effect.ts:123](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L123) +Defined in: [packages/db/src/query/effect.ts:124](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L124) Called once for each row entering the query result @@ -61,7 +61,7 @@ Called once for each row entering the query result optional onError: (error, event) => void; ``` -Defined in: [packages/db/src/query/effect.ts:135](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L135) +Defined in: [packages/db/src/query/effect.ts:136](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L136) Error handler for exceptions thrown by effect callbacks @@ -87,7 +87,7 @@ Error handler for exceptions thrown by effect callbacks optional onExit: EffectEventHandler; ``` -Defined in: [packages/db/src/query/effect.ts:129](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L129) +Defined in: [packages/db/src/query/effect.ts:130](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L130) Called once for each row exiting the query result @@ -99,7 +99,7 @@ Called once for each row exiting the query result optional onHealthChange: (health) => void; ``` -Defined in: [packages/db/src/query/effect.ts:153](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L153) +Defined in: [packages/db/src/query/effect.ts:154](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L154) Called after the effect's initial-query readiness whenever its health tree changes. A sync problem after initial-query readiness does not dispose the @@ -123,7 +123,7 @@ effect; read the health tree to decide what to do. optional onSourceError: (error) => void; ``` -Defined in: [packages/db/src/query/effect.ts:146](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L146) +Defined in: [packages/db/src/query/effect.ts:147](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L147) Called when a source crashes, fails its first load before the effect's initial-query readiness, or is cleaned up while the effect reads it, and @@ -151,7 +151,7 @@ provided, the error is logged to console.error. optional onUpdate: EffectEventHandler; ``` -Defined in: [packages/db/src/query/effect.ts:126](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L126) +Defined in: [packages/db/src/query/effect.ts:127](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L127) Called once for each row updating within the query result @@ -163,7 +163,7 @@ Called once for each row updating within the query result query: EffectQueryInput; ``` -Defined in: [packages/db/src/query/effect.ts:120](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L120) +Defined in: [packages/db/src/query/effect.ts:121](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L121) Query to watch for deltas @@ -175,7 +175,7 @@ Query to watch for deltas optional skipInitial: boolean; ``` -Defined in: [packages/db/src/query/effect.ts:160](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L160) +Defined in: [packages/db/src/query/effect.ts:161](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L161) Skip deltas during initial collection load. Defaults to false (process all deltas including initial sync). diff --git a/docs/reference/interfaces/EffectContext.md b/docs/reference/interfaces/EffectContext.md index 49801294eb..5901500a6b 100644 --- a/docs/reference/interfaces/EffectContext.md +++ b/docs/reference/interfaces/EffectContext.md @@ -3,7 +3,7 @@ id: EffectContext title: EffectContext --- -Defined in: [packages/db/src/query/effect.ts:87](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L87) +Defined in: [packages/db/src/query/effect.ts:88](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L88) Context passed to effect handlers @@ -15,7 +15,7 @@ Context passed to effect handlers effectId: string; ``` -Defined in: [packages/db/src/query/effect.ts:89](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L89) +Defined in: [packages/db/src/query/effect.ts:90](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L90) ID of this effect (auto-generated if not provided) @@ -27,6 +27,6 @@ ID of this effect (auto-generated if not provided) signal: AbortSignal; ``` -Defined in: [packages/db/src/query/effect.ts:91](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L91) +Defined in: [packages/db/src/query/effect.ts:92](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L92) Aborted when effect.dispose() is called diff --git a/docs/reference/interfaces/HealthNode.md b/docs/reference/interfaces/HealthNode.md index 0c4b623ab1..4b52c609d2 100644 --- a/docs/reference/interfaces/HealthNode.md +++ b/docs/reference/interfaces/HealthNode.md @@ -3,7 +3,7 @@ id: HealthNode title: HealthNode --- -Defined in: [packages/db/src/types.ts:813](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L813) +Defined in: [packages/db/src/types.ts:856](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L856) One node of a health tree. A Collection's tree is one node; a live query's has one node for itself and one for each source alias in query order. The @@ -22,7 +22,7 @@ crashed, or, on a live query's own node, a request for more data failed. readonly alias: string; ``` -Defined in: [packages/db/src/types.ts:815](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L815) +Defined in: [packages/db/src/types.ts:858](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L858) The query alias, or `root` for the Collection the tree was read from. @@ -34,27 +34,27 @@ The query alias, or `root` for the Collection the tree was read from. readonly collectionId: string; ``` -Defined in: [packages/db/src/types.ts:816](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L816) +Defined in: [packages/db/src/types.ts:859](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L859) *** ### error ```ts -readonly error: CollectionErrorInfo | null; +readonly error: HealthProblem | null; ``` -Defined in: [packages/db/src/types.ts:823](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L823) +Defined in: [packages/db/src/types.ts:866](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L866) *** ### failureReason ```ts -readonly failureReason: CollectionErrorInfo | null; +readonly failureReason: HealthProblem | null; ``` -Defined in: [packages/db/src/types.ts:822](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L822) +Defined in: [packages/db/src/types.ts:865](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L865) *** @@ -64,7 +64,7 @@ Defined in: [packages/db/src/types.ts:822](https://github.com/TanStack/db/blob/m readonly hasErrors: boolean; ``` -Defined in: [packages/db/src/types.ts:821](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L821) +Defined in: [packages/db/src/types.ts:864](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L864) This node or any node below it has a `failureReason` or an `error`. @@ -76,7 +76,7 @@ This node or any node below it has a `failureReason` or an `error`. readonly kind: "source" | "include" | "live-query"; ``` -Defined in: [packages/db/src/types.ts:818](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L818) +Defined in: [packages/db/src/types.ts:861](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L861) `include` is an include's source; its rows feed per-row child Collections. @@ -88,7 +88,7 @@ Defined in: [packages/db/src/types.ts:818](https://github.com/TanStack/db/blob/m readonly reloading: boolean; ``` -Defined in: [packages/db/src/types.ts:828](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L828) +Defined in: [packages/db/src/types.ts:871](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L871) A reload's new sync run is in flight: the rows, status, and problem shown are the previous run's until it commits or fails. @@ -101,7 +101,7 @@ are the previous run's until it commits or fails. readonly sources: readonly HealthNode[]; ``` -Defined in: [packages/db/src/types.ts:829](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L829) +Defined in: [packages/db/src/types.ts:872](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L872) *** @@ -111,4 +111,4 @@ Defined in: [packages/db/src/types.ts:829](https://github.com/TanStack/db/blob/m readonly status: CollectionStatus; ``` -Defined in: [packages/db/src/types.ts:819](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L819) +Defined in: [packages/db/src/types.ts:862](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L862) diff --git a/docs/reference/interfaces/HealthProblem.md b/docs/reference/interfaces/HealthProblem.md new file mode 100644 index 0000000000..08f0f0bc04 --- /dev/null +++ b/docs/reference/interfaces/HealthProblem.md @@ -0,0 +1,102 @@ +--- +id: HealthProblem +title: HealthProblem +--- + +Defined in: [packages/db/src/types.ts:842](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L842) + +A problem on a health node. Its own fields are its newest failure's, and +`errors` lists every failure of its frame that is still open, oldest +first; the last entry is the newest. A source's `failureReason` lists each +`reportError()` of the sync run since the problem began, once per error +value; `reportHealthy(error)` removes that value's failure, and +`reportHealthy()` ends it. An `error` from `fail()`, a failed first load, or a crash is one +failure. A query's request error lists every request failure still open +on its node, once per error value, and a failed replay adds each load it +failed for. + +## Extends + +- [`CollectionErrorInfo`](CollectionErrorInfo.md) + +## Properties + +### at + +```ts +readonly at: number; +``` + +Defined in: [packages/db/src/types.ts:827](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L827) + +Epoch milliseconds when the problem was reported. + +#### Inherited from + +[`CollectionErrorInfo`](CollectionErrorInfo.md).[`at`](CollectionErrorInfo.md#at) + +*** + +### cause + +```ts +readonly cause: unknown; +``` + +Defined in: [packages/db/src/types.ts:828](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L828) + +#### Inherited from + +[`CollectionErrorInfo`](CollectionErrorInfo.md).[`cause`](CollectionErrorInfo.md#cause) + +*** + +### code? + +```ts +readonly optional code: string; +``` + +Defined in: [packages/db/src/types.ts:825](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L825) + +#### Inherited from + +[`CollectionErrorInfo`](CollectionErrorInfo.md).[`code`](CollectionErrorInfo.md#code) + +*** + +### errors + +```ts +readonly errors: readonly CollectionErrorInfo[]; +``` + +Defined in: [packages/db/src/types.ts:843](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L843) + +*** + +### message + +```ts +readonly message: string; +``` + +Defined in: [packages/db/src/types.ts:824](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L824) + +#### Inherited from + +[`CollectionErrorInfo`](CollectionErrorInfo.md).[`message`](CollectionErrorInfo.md#message) + +*** + +### name + +```ts +readonly name: string; +``` + +Defined in: [packages/db/src/types.ts:823](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L823) + +#### Inherited from + +[`CollectionErrorInfo`](CollectionErrorInfo.md).[`name`](CollectionErrorInfo.md#name) diff --git a/docs/reference/interfaces/IndexedDBCollectionConfig.md b/docs/reference/interfaces/IndexedDBCollectionConfig.md index 4e7685f8ce..537226840f 100644 --- a/docs/reference/interfaces/IndexedDBCollectionConfig.md +++ b/docs/reference/interfaces/IndexedDBCollectionConfig.md @@ -33,7 +33,7 @@ Configuration options for creating an IndexedDB Collection optional autoIndex: "eager" | "off"; ``` -Defined in: [packages/db/src/types.ts:886](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L886) +Defined in: [packages/db/src/types.ts:937](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L937) Auto-indexing mode for the collection. When enabled, indexes will be automatically created for simple where expressions. @@ -62,7 +62,7 @@ When enabled, indexes will be automatically created for simple where expressions optional compare: (x, y) => number; ``` -Defined in: [packages/db/src/types.ts:911](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L911) +Defined in: [packages/db/src/types.ts:962](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L962) Optional function to compare two items. This is used to order the items in the collection. @@ -119,7 +119,7 @@ REQUIRED - must create database before collections optional defaultIndexType: IndexConstructor; ``` -Defined in: [packages/db/src/types.ts:900](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L900) +Defined in: [packages/db/src/types.ts:951](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L951) Default index type to use when creating indexes without an explicit type. Required for auto-indexing. Import from '@tanstack/db'. @@ -147,7 +147,7 @@ const collection = createCollection({ optional defaultStringCollation: StringCollationConfig; ``` -Defined in: [packages/db/src/types.ts:1106](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1106) +Defined in: [packages/db/src/types.ts:1137](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1137) Specifies how to compare data in the collection. This should be configured to match data ordering on the backend. @@ -166,13 +166,22 @@ E.g., when using the Electric DB collection these options optional gcTime: number; ``` -Defined in: [packages/db/src/types.ts:865](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L865) +Defined in: [packages/db/src/types.ts:916](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L916) Time in milliseconds after which the collection will be garbage collected when it has no active subscribers. Defaults to 5 minutes (300000ms). -Sync started without subscribers gets a minimum 50ms grace period. +Sync started without subscribers gets a minimum 50ms handoff grace period +until a subscriber attaches. After the last subscriber leaves, gcTime +applies without that startup minimum. Pending preloads retain the collection until they settle. Preloading ready -data refreshes the retention period. A non-positive or non-finite value +data refreshes the retention period. A persisting transaction that touches +the collection also retains it, and the period starts again when the last +one completes or fails, preserving any remaining startup grace. Pending +manual transactions do not retain it; keep a subscription for draft +visibility until commit or rollback. Rolling +back a manual transaction that stayed pending preserves the existing GC +deadline. Cleanup runs at a host idle opportunity after the delay. +A non-positive or non-finite value disables automatic garbage collection. #### Inherited from @@ -187,7 +196,7 @@ disables automatic garbage collection. getKey: (item) => TKey; ``` -Defined in: [packages/db/src/types.ts:856](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L856) +Defined in: [packages/db/src/types.ts:898](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L898) Function to extract the ID from an object This is required for update/delete operations which now only accept IDs @@ -225,7 +234,7 @@ getKey: (item) => item.uuid optional id: string; ``` -Defined in: [packages/db/src/types.ts:845](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L845) +Defined in: [packages/db/src/types.ts:887](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L887) #### Inherited from @@ -249,15 +258,12 @@ Must exist in the underlying database ### onDelete? ```ts -optional onDelete: - | DeleteMutationFn -| DeleteMutationFn; +optional onDelete: DeleteMutationFn; ``` -Defined in: [packages/db/src/types.ts:1095](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1095) +Defined in: [packages/db/src/types.ts:1129](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1129) Optional asynchronous handler function called before a delete operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -276,8 +282,6 @@ onDelete: async ({ transaction, collection }) => { await api.deleteTodos(keysToDelete) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -326,15 +330,12 @@ onDelete: async ({ transaction, collection }) => { ### onInsert? ```ts -optional onInsert: - | InsertMutationFn -| InsertMutationFn; +optional onInsert: InsertMutationFn; ``` -Defined in: [packages/db/src/types.ts:974](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L974) +Defined in: [packages/db/src/types.ts:1021](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1021) Optional asynchronous handler function called before an insert operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -353,8 +354,6 @@ onInsert: async ({ transaction, collection }) => { await api.createTodo(newItem) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -375,7 +374,6 @@ onInsert: async ({ transaction, collection }) => { await api.createTodos(items) // Refetch to get updated data from server await collection.utils.refetch() - return { refetch: false } } ``` @@ -401,15 +399,12 @@ onInsert: async ({ transaction, collection }) => { ### onUpdate? ```ts -optional onUpdate: - | UpdateMutationFn -| UpdateMutationFn; +optional onUpdate: UpdateMutationFn; ``` -Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) +Defined in: [packages/db/src/types.ts:1076](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1076) Optional asynchronous handler function called before an update operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -429,8 +424,6 @@ onUpdate: async ({ transaction, collection }) => { await api.updateTodo(mutation.original.id, changes) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -453,7 +446,6 @@ onUpdate: async ({ transaction, collection }) => { })) await api.updateTodos(updates) await collection.utils.refetch() - return { refetch: false } } ``` @@ -483,7 +475,7 @@ onUpdate: async ({ transaction, collection }) => { optional schema: TSchema; ``` -Defined in: [packages/db/src/types.ts:846](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L846) +Defined in: [packages/db/src/types.ts:888](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L888) #### Inherited from @@ -497,7 +489,7 @@ Defined in: [packages/db/src/types.ts:846](https://github.com/TanStack/db/blob/m optional startSync: boolean; ``` -Defined in: [packages/db/src/types.ts:876](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L876) +Defined in: [packages/db/src/types.ts:927](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L927) Whether to eagerly start syncing on collection creation. When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches. @@ -524,7 +516,7 @@ false optional syncMode: SyncMode; ``` -Defined in: [packages/db/src/types.ts:920](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L920) +Defined in: [packages/db/src/types.ts:971](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L971) The mode of sync to use for the collection. @@ -550,7 +542,7 @@ The exact implementation of the sync mode is up to the sync implementation. optional utils: UtilsRecord; ``` -Defined in: [packages/db/src/types.ts:1108](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1108) +Defined in: [packages/db/src/types.ts:1139](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1139) #### Inherited from diff --git a/docs/reference/interfaces/InsertConfig.md b/docs/reference/interfaces/InsertConfig.md index e99c2a1e7a..f88c3ce284 100644 --- a/docs/reference/interfaces/InsertConfig.md +++ b/docs/reference/interfaces/InsertConfig.md @@ -3,7 +3,7 @@ id: InsertConfig title: InsertConfig --- -Defined in: [packages/db/src/types.ts:678](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L678) +Defined in: [packages/db/src/types.ts:718](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L718) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/db/src/types.ts:678](https://github.com/TanStack/db/blob/m optional metadata: Record; ``` -Defined in: [packages/db/src/types.ts:679](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L679) +Defined in: [packages/db/src/types.ts:719](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L719) *** @@ -23,6 +23,6 @@ Defined in: [packages/db/src/types.ts:679](https://github.com/TanStack/db/blob/m optional optimistic: boolean; ``` -Defined in: [packages/db/src/types.ts:681](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L681) +Defined in: [packages/db/src/types.ts:721](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L721) Whether to apply optimistic updates immediately. Defaults to true. diff --git a/docs/reference/interfaces/LiveQueryCollectionConfig.md b/docs/reference/interfaces/LiveQueryCollectionConfig.md index 3db8c67a48..8251f59ba7 100644 --- a/docs/reference/interfaces/LiveQueryCollectionConfig.md +++ b/docs/reference/interfaces/LiveQueryCollectionConfig.md @@ -105,9 +105,7 @@ If not provided, defaults to `live-query-${number}` with auto-incrementing numbe ### onDelete? ```ts -optional onDelete: - | DeleteMutationFn -| DeleteMutationFn; +optional onDelete: DeleteMutationFn; ``` Defined in: [packages/db/src/query/live/types.ts:101](https://github.com/TanStack/db/blob/main/packages/db/src/query/live/types.ts#L101) @@ -117,9 +115,7 @@ Defined in: [packages/db/src/query/live/types.ts:101](https://github.com/TanStac ### onInsert? ```ts -optional onInsert: - | InsertMutationFn -| InsertMutationFn; +optional onInsert: InsertMutationFn; ``` Defined in: [packages/db/src/query/live/types.ts:99](https://github.com/TanStack/db/blob/main/packages/db/src/query/live/types.ts#L99) @@ -131,9 +127,7 @@ Optional mutation handlers ### onUpdate? ```ts -optional onUpdate: - | UpdateMutationFn -| UpdateMutationFn; +optional onUpdate: UpdateMutationFn; ``` Defined in: [packages/db/src/query/live/types.ts:100](https://github.com/TanStack/db/blob/main/packages/db/src/query/live/types.ts#L100) diff --git a/docs/reference/interfaces/LiveQueryObserver.md b/docs/reference/interfaces/LiveQueryObserver.md index 76e0dcbdd9..b710d132c7 100644 --- a/docs/reference/interfaces/LiveQueryObserver.md +++ b/docs/reference/interfaces/LiveQueryObserver.md @@ -3,7 +3,7 @@ id: LiveQueryObserver title: LiveQueryObserver --- -Defined in: [packages/db/src/live-query-observer.ts:93](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L93) +Defined in: [packages/db/src/live-query-observer.ts:90](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L90) **`Internal`** @@ -38,7 +38,7 @@ not a public extension point yet; may change in any release. dehydrate: () => DehydratedLiveQueryResult; ``` -Defined in: [packages/db/src/live-query-observer.ts:113](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L113) +Defined in: [packages/db/src/live-query-observer.ts:110](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L110) Capture the ordered query result without serializing its source collections. @@ -54,7 +54,7 @@ Capture the ordered query result without serializing its source collections. dispose: () => void; ``` -Defined in: [packages/db/src/live-query-observer.ts:115](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L115) +Defined in: [packages/db/src/live-query-observer.ts:112](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L112) Idempotent teardown. @@ -70,7 +70,7 @@ Idempotent teardown. getError: () => unknown; ``` -Defined in: [packages/db/src/live-query-observer.ts:111](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L111) +Defined in: [packages/db/src/live-query-observer.ts:108](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L108) The transport or preload error for this query, if it has not produced data. @@ -86,7 +86,7 @@ The transport or preload error for this query, if it has not produced data. getServerSnapshot: (preloadRequested?) => LiveQuerySnapshot; ``` -Defined in: [packages/db/src/live-query-observer.ts:100](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L100) +Defined in: [packages/db/src/live-query-observer.ts:97](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L97) Server snapshot. preloadRequested marks an explicit streaming Suspense load. @@ -108,7 +108,7 @@ Server snapshot. preloadRequested marks an explicit streaming Suspense load. getSnapshot: () => LiveQuerySnapshot; ``` -Defined in: [packages/db/src/live-query-observer.ts:98](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L98) +Defined in: [packages/db/src/live-query-observer.ts:95](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L95) Stable per-revision snapshot for wholesale materialization. @@ -124,7 +124,7 @@ Stable per-revision snapshot for wholesale materialization. preload: () => Promise; ``` -Defined in: [packages/db/src/live-query-observer.ts:109](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L109) +Defined in: [packages/db/src/live-query-observer.ts:106](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L106) Resolve once the collection has loaded its first data. @@ -140,7 +140,7 @@ Resolve once the collection has loaded its first data. subscribe: (listener) => () => void; ``` -Defined in: [packages/db/src/live-query-observer.ts:107](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L107) +Defined in: [packages/db/src/live-query-observer.ts:104](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L104) Subscribe to changes. The listener receives the change set (or `undefined` for the synthetic notify a ready collection emits on attach). Granular diff --git a/docs/reference/interfaces/LiveQuerySnapshot.md b/docs/reference/interfaces/LiveQuerySnapshot.md index bfbdef6acb..d47c8b703d 100644 --- a/docs/reference/interfaces/LiveQuerySnapshot.md +++ b/docs/reference/interfaces/LiveQuerySnapshot.md @@ -3,7 +3,7 @@ id: LiveQuerySnapshot title: LiveQuerySnapshot --- -Defined in: [packages/db/src/live-query-observer.ts:26](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L26) +Defined in: [packages/db/src/live-query-observer.ts:23](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L23) The canonical, adapter-agnostic view of a live query at a point in time. @@ -32,7 +32,7 @@ collection: | undefined; ``` -Defined in: [packages/db/src/live-query-observer.ts:35](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L35) +Defined in: [packages/db/src/live-query-observer.ts:32](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L32) The underlying collection, or `undefined` when disabled. @@ -44,7 +44,7 @@ The underlying collection, or `undefined` when disabled. data: T | readonly T[] | undefined; ``` -Defined in: [packages/db/src/live-query-observer.ts:33](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L33) +Defined in: [packages/db/src/live-query-observer.ts:30](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L30) Ordered results (single row for `findOne`), or `undefined` when disabled. @@ -56,7 +56,7 @@ Ordered results (single row for `findOne`), or `undefined` when disabled. health: HealthNode | undefined; ``` -Defined in: [packages/db/src/live-query-observer.ts:67](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L67) +Defined in: [packages/db/src/live-query-observer.ts:64](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L64) The health tree for the query and every Collection it depends on, or `undefined` for a disabled query. After the first ready, a source @@ -70,7 +70,7 @@ problem shows here and the data stays. isCleanedUp: boolean; ``` -Defined in: [packages/db/src/live-query-observer.ts:55](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L55) +Defined in: [packages/db/src/live-query-observer.ts:52](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L52) *** @@ -80,7 +80,7 @@ Defined in: [packages/db/src/live-query-observer.ts:55](https://github.com/TanSt isCrashed: boolean; ``` -Defined in: [packages/db/src/live-query-observer.ts:54](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L54) +Defined in: [packages/db/src/live-query-observer.ts:51](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L51) Local storage or an invariant broke. Only a cascade cleanup and a fresh start recover. @@ -92,7 +92,7 @@ Local storage or an invariant broke. Only a cascade cleanup and a fresh start re isEnabled: boolean; ``` -Defined in: [packages/db/src/live-query-observer.ts:56](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L56) +Defined in: [packages/db/src/live-query-observer.ts:53](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L53) *** @@ -102,7 +102,7 @@ Defined in: [packages/db/src/live-query-observer.ts:56](https://github.com/TanSt isIdle: boolean; ``` -Defined in: [packages/db/src/live-query-observer.ts:50](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L50) +Defined in: [packages/db/src/live-query-observer.ts:47](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L47) *** @@ -112,7 +112,7 @@ Defined in: [packages/db/src/live-query-observer.ts:50](https://github.com/TanSt isLoading: boolean; ``` -Defined in: [packages/db/src/live-query-observer.ts:48](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L48) +Defined in: [packages/db/src/live-query-observer.ts:45](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L45) *** @@ -122,7 +122,7 @@ Defined in: [packages/db/src/live-query-observer.ts:48](https://github.com/TanSt isLoadingError: boolean; ``` -Defined in: [packages/db/src/live-query-observer.ts:52](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L52) +Defined in: [packages/db/src/live-query-observer.ts:49](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L49) The first load failed: there is nothing to show. @@ -134,7 +134,7 @@ The first load failed: there is nothing to show. isReady: boolean; ``` -Defined in: [packages/db/src/live-query-observer.ts:49](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L49) +Defined in: [packages/db/src/live-query-observer.ts:46](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L46) *** @@ -144,7 +144,7 @@ Defined in: [packages/db/src/live-query-observer.ts:49](https://github.com/TanSt isSyncError: boolean; ``` -Defined in: [packages/db/src/live-query-observer.ts:61](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L61) +Defined in: [packages/db/src/live-query-observer.ts:58](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L58) The data is shown, and something keeps it from staying current: a sync problem or a failed request somewhere in `health`. @@ -157,7 +157,7 @@ problem or a failed request somewhere in `health`. layoutRevision: number; ``` -Defined in: [packages/db/src/live-query-observer.ts:46](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L46) +Defined in: [packages/db/src/live-query-observer.ts:43](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L43) Monotonic counter bumped whenever the visible layout (the ordered key sequence) changes — membership, ordering, or an order-only move. Lets @@ -176,7 +176,7 @@ always accompanies a new snapshot, but not vice versa. state: ReadonlyMap | undefined; ``` -Defined in: [packages/db/src/live-query-observer.ts:31](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L31) +Defined in: [packages/db/src/live-query-observer.ts:28](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L28) Keyed results, or `undefined` for a disabled query. @@ -188,4 +188,4 @@ Keyed results, or `undefined` for a disabled query. status: CollectionStatus | "disabled"; ``` -Defined in: [packages/db/src/live-query-observer.ts:47](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L47) +Defined in: [packages/db/src/live-query-observer.ts:44](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L44) diff --git a/docs/reference/interfaces/LiveQueryStatusFlags.md b/docs/reference/interfaces/LiveQueryStatusFlags.md index 98a17a7254..7ab4149ad8 100644 --- a/docs/reference/interfaces/LiveQueryStatusFlags.md +++ b/docs/reference/interfaces/LiveQueryStatusFlags.md @@ -3,19 +3,33 @@ id: LiveQueryStatusFlags title: LiveQueryStatusFlags --- -Defined in: [packages/db/src/live-query-primitives.ts:51](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L51) +Defined in: [packages/db/src/live-query-primitives.ts:59](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L59) -The derived boolean status flags every adapter exposes for a query. +The derived flags and health every adapter exposes for a query, besides +`status`, which each adapter reports as its own field. ## Properties +### health + +```ts +health: HealthNode | undefined; +``` + +Defined in: [packages/db/src/live-query-primitives.ts:78](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L78) + +The health tree for the query and every Collection it depends on, or +`undefined` for a disabled query. + +*** + ### isCleanedUp ```ts isCleanedUp: boolean; ``` -Defined in: [packages/db/src/live-query-primitives.ts:59](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L59) +Defined in: [packages/db/src/live-query-primitives.ts:67](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L67) *** @@ -25,7 +39,7 @@ Defined in: [packages/db/src/live-query-primitives.ts:59](https://github.com/Tan isCrashed: boolean; ``` -Defined in: [packages/db/src/live-query-primitives.ts:58](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L58) +Defined in: [packages/db/src/live-query-primitives.ts:66](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L66) Local storage or an invariant broke. `status` is `crashed`. @@ -37,7 +51,7 @@ Local storage or an invariant broke. `status` is `crashed`. isIdle: boolean; ``` -Defined in: [packages/db/src/live-query-primitives.ts:54](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L54) +Defined in: [packages/db/src/live-query-primitives.ts:62](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L62) *** @@ -47,7 +61,7 @@ Defined in: [packages/db/src/live-query-primitives.ts:54](https://github.com/Tan isLoading: boolean; ``` -Defined in: [packages/db/src/live-query-primitives.ts:52](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L52) +Defined in: [packages/db/src/live-query-primitives.ts:60](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L60) *** @@ -57,7 +71,7 @@ Defined in: [packages/db/src/live-query-primitives.ts:52](https://github.com/Tan isLoadingError: boolean; ``` -Defined in: [packages/db/src/live-query-primitives.ts:56](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L56) +Defined in: [packages/db/src/live-query-primitives.ts:64](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L64) The first load failed: there is nothing to show. `status` is `error`. @@ -69,4 +83,18 @@ The first load failed: there is nothing to show. `status` is `error`. isReady: boolean; ``` -Defined in: [packages/db/src/live-query-primitives.ts:53](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L53) +Defined in: [packages/db/src/live-query-primitives.ts:61](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L61) + +*** + +### isSyncError + +```ts +isSyncError: boolean; +``` + +Defined in: [packages/db/src/live-query-primitives.ts:73](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-primitives.ts#L73) + +The data is shown, and something keeps it from staying current: a sync +problem or failed request somewhere in `health`. Set only while `status` is +`ready`; a disabled query is never in a sync error. diff --git a/docs/reference/interfaces/LiveQueryWindowBinding.md b/docs/reference/interfaces/LiveQueryWindowBinding.md index 8fe724e241..075acc613b 100644 --- a/docs/reference/interfaces/LiveQueryWindowBinding.md +++ b/docs/reference/interfaces/LiveQueryWindowBinding.md @@ -3,7 +3,7 @@ id: LiveQueryWindowBinding title: LiveQueryWindowBinding --- -Defined in: [packages/db/src/live-query-window-binding.ts:93](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L93) +Defined in: [packages/db/src/live-query-window-binding.ts:92](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L92) Validated infinite-query page shape. @@ -19,7 +19,7 @@ Validated infinite-query page shape. collection: Collection; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:98](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L98) +Defined in: [packages/db/src/live-query-window-binding.ts:97](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L97) *** @@ -29,7 +29,7 @@ Defined in: [packages/db/src/live-query-window-binding.ts:98](https://github.com controller: LiveQueryWindowController; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:103](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L103) +Defined in: [packages/db/src/live-query-window-binding.ts:102](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L102) *** @@ -39,7 +39,7 @@ Defined in: [packages/db/src/live-query-window-binding.ts:103](https://github.co dependencies: readonly unknown[] | undefined; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:96](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L96) +Defined in: [packages/db/src/live-query-window-binding.ts:95](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L95) *** @@ -49,7 +49,7 @@ Defined in: [packages/db/src/live-query-window-binding.ts:96](https://github.com initialPageParam: number; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:40](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L40) +Defined in: [packages/db/src/live-query-window-binding.ts:41](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L41) First result-page label, not a server cursor or remote offset. @@ -65,7 +65,7 @@ First result-page label, not a server cursor or remote offset. ownsCollection: boolean; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:102](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L102) +Defined in: [packages/db/src/live-query-window-binding.ts:101](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L101) Whether this binding created `collection` from a query. @@ -77,7 +77,7 @@ Whether this binding created `collection` from a query. pageSize: number; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:38](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L38) +Defined in: [packages/db/src/live-query-window-binding.ts:39](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L39) #### Inherited from @@ -91,7 +91,7 @@ Defined in: [packages/db/src/live-query-window-binding.ts:38](https://github.com queryHash: string | undefined; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:100](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L100) +Defined in: [packages/db/src/live-query-window-binding.ts:99](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L99) The transport identity of this binding's initial query window. @@ -103,7 +103,7 @@ The transport identity of this binding's initial query window. scope: unknown; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:97](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L97) +Defined in: [packages/db/src/live-query-window-binding.ts:96](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L96) *** @@ -115,7 +115,7 @@ supplied: | undefined; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:95](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L95) +Defined in: [packages/db/src/live-query-window-binding.ts:94](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L94) The supplied Collection; `undefined` for a query input. @@ -127,7 +127,7 @@ The supplied Collection; `undefined` for a query input. warning: string | undefined; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:108](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L108) +Defined in: [packages/db/src/live-query-window-binding.ts:107](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L107) A developer hint about a newly bound supplied collection's window, for the adapter to print once. Production builds carry none. diff --git a/docs/reference/interfaces/LiveQueryWindowController.md b/docs/reference/interfaces/LiveQueryWindowController.md index 9904210da6..61deb6e750 100644 --- a/docs/reference/interfaces/LiveQueryWindowController.md +++ b/docs/reference/interfaces/LiveQueryWindowController.md @@ -3,7 +3,7 @@ id: LiveQueryWindowController title: LiveQueryWindowController --- -Defined in: [packages/db/src/live-query-window-controller.ts:552](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L552) +Defined in: [packages/db/src/live-query-window-controller.ts:555](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L555) **`Internal`** @@ -27,7 +27,7 @@ This contract is unstable while RFC #1623 is being implemented. dispose: () => void; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:564](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L564) +Defined in: [packages/db/src/live-query-window-controller.ts:567](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L567) #### Returns @@ -41,7 +41,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:564](https://github fetchNextPage: () => Promise; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:560](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L560) +Defined in: [packages/db/src/live-query-window-controller.ts:563](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L563) Load one more page, resolving only after that page is committed. @@ -57,7 +57,7 @@ Load one more page, resolving only after that page is committed. getServerSnapshot: () => LiveQueryWindowSnapshot; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:557](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L557) +Defined in: [packages/db/src/live-query-window-controller.ts:560](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L560) #### Returns @@ -71,7 +71,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:557](https://github getSnapshot: () => LiveQueryWindowSnapshot; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:556](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L556) +Defined in: [packages/db/src/live-query-window-controller.ts:559](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L559) #### Returns @@ -85,7 +85,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:556](https://github preload: () => Promise; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:563](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L563) +Defined in: [packages/db/src/live-query-window-controller.ts:566](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L566) #### Returns @@ -99,7 +99,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:563](https://github reset: () => Promise; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:562](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L562) +Defined in: [packages/db/src/live-query-window-controller.ts:565](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L565) Reset to the first page, resolving after the smaller window is accepted. @@ -115,7 +115,7 @@ Reset to the first page, resolving after the smaller window is accepted. subscribe: (listener) => () => void; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:558](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L558) +Defined in: [packages/db/src/live-query-window-controller.ts:561](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L561) #### Parameters diff --git a/docs/reference/interfaces/LiveQueryWindowPageShape.md b/docs/reference/interfaces/LiveQueryWindowPageShape.md index 430df2681f..887fea5de6 100644 --- a/docs/reference/interfaces/LiveQueryWindowPageShape.md +++ b/docs/reference/interfaces/LiveQueryWindowPageShape.md @@ -3,7 +3,7 @@ id: LiveQueryWindowPageShape title: LiveQueryWindowPageShape --- -Defined in: [packages/db/src/live-query-window-binding.ts:37](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L37) +Defined in: [packages/db/src/live-query-window-binding.ts:38](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L38) Validated infinite-query page shape. @@ -20,7 +20,7 @@ Validated infinite-query page shape. initialPageParam: number; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:40](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L40) +Defined in: [packages/db/src/live-query-window-binding.ts:41](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L41) First result-page label, not a server cursor or remote offset. @@ -32,4 +32,4 @@ First result-page label, not a server cursor or remote offset. pageSize: number; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:38](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L38) +Defined in: [packages/db/src/live-query-window-binding.ts:39](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L39) diff --git a/docs/reference/interfaces/LiveQueryWindowSnapshot.md b/docs/reference/interfaces/LiveQueryWindowSnapshot.md index 395b59cbd5..fb0ca89eb4 100644 --- a/docs/reference/interfaces/LiveQueryWindowSnapshot.md +++ b/docs/reference/interfaces/LiveQueryWindowSnapshot.md @@ -3,7 +3,7 @@ id: LiveQueryWindowSnapshot title: LiveQueryWindowSnapshot --- -Defined in: [packages/db/src/live-query-window-controller.ts:510](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L510) +Defined in: [packages/db/src/live-query-window-controller.ts:513](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L513) **`Internal`** @@ -31,7 +31,7 @@ collection: | undefined; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:524](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L524) +Defined in: [packages/db/src/live-query-window-controller.ts:527](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L527) *** @@ -41,7 +41,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:524](https://github data: readonly T[]; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:515](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L515) +Defined in: [packages/db/src/live-query-window-controller.ts:518](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L518) Rows across all committed pages, with the peek-ahead row removed. @@ -53,7 +53,7 @@ Rows across all committed pages, with the peek-ahead row removed. hasNextPage: boolean; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:520](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L520) +Defined in: [packages/db/src/live-query-window-controller.ts:523](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L523) *** @@ -63,7 +63,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:520](https://github health: HealthNode | undefined; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:536](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L536) +Defined in: [packages/db/src/live-query-window-controller.ts:539](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L539) The health tree for the collection and its dependencies, or `undefined` when disabled. @@ -75,7 +75,7 @@ The health tree for the collection and its dependencies, or `undefined` when dis isCleanedUp: boolean; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:531](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L531) +Defined in: [packages/db/src/live-query-window-controller.ts:534](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L534) *** @@ -85,7 +85,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:531](https://github isCrashed: boolean; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:530](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L530) +Defined in: [packages/db/src/live-query-window-controller.ts:533](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L533) *** @@ -95,7 +95,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:530](https://github isEnabled: boolean; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:532](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L532) +Defined in: [packages/db/src/live-query-window-controller.ts:535](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L535) *** @@ -105,7 +105,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:532](https://github isFetchingNextPage: boolean; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:521](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L521) +Defined in: [packages/db/src/live-query-window-controller.ts:524](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L524) *** @@ -115,7 +115,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:521](https://github isIdle: boolean; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:528](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L528) +Defined in: [packages/db/src/live-query-window-controller.ts:531](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L531) *** @@ -125,7 +125,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:528](https://github isLoading: boolean; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:526](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L526) +Defined in: [packages/db/src/live-query-window-controller.ts:529](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L529) *** @@ -135,7 +135,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:526](https://github isLoadingError: boolean; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:529](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L529) +Defined in: [packages/db/src/live-query-window-controller.ts:532](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L532) *** @@ -145,7 +145,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:529](https://github isReady: boolean; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:527](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L527) +Defined in: [packages/db/src/live-query-window-controller.ts:530](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L530) *** @@ -155,7 +155,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:527](https://github isSyncError: boolean; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:534](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L534) +Defined in: [packages/db/src/live-query-window-controller.ts:537](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L537) The data is shown, and a sync problem or failed page load is in `health`. @@ -167,7 +167,7 @@ The data is shown, and a sync problem or failed page load is in `health`. pageParams: readonly number[]; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:519](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L519) +Defined in: [packages/db/src/live-query-window-controller.ts:522](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L522) `initialPageParam + i` for each committed page. @@ -179,7 +179,7 @@ Defined in: [packages/db/src/live-query-window-controller.ts:519](https://github pages: readonly readonly T[][]; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:517](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L517) +Defined in: [packages/db/src/live-query-window-controller.ts:520](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L520) Rows grouped into committed pages of `pageSize`. @@ -191,7 +191,7 @@ Rows grouped into committed pages of `pageSize`. state: ReadonlyMap | undefined; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:523](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L523) +Defined in: [packages/db/src/live-query-window-controller.ts:526](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L526) Keyed results for the physical window, or `undefined` when disabled. @@ -203,4 +203,4 @@ Keyed results for the physical window, or `undefined` when disabled. status: CollectionStatus | "disabled"; ``` -Defined in: [packages/db/src/live-query-window-controller.ts:525](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L525) +Defined in: [packages/db/src/live-query-window-controller.ts:528](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-controller.ts#L528) diff --git a/docs/reference/interfaces/LiveQueryWindowUpdate.md b/docs/reference/interfaces/LiveQueryWindowUpdate.md index 143382760b..7fd4c9f46c 100644 --- a/docs/reference/interfaces/LiveQueryWindowUpdate.md +++ b/docs/reference/interfaces/LiveQueryWindowUpdate.md @@ -3,7 +3,7 @@ id: LiveQueryWindowUpdate title: LiveQueryWindowUpdate --- -Defined in: [packages/db/src/live-query-window-binding.ts:76](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L76) +Defined in: [packages/db/src/live-query-window-binding.ts:75](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L75) Validated infinite-query page shape. @@ -19,7 +19,7 @@ Validated infinite-query page shape. optional client: DbClient; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:88](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L88) +Defined in: [packages/db/src/live-query-window-binding.ts:87](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L87) Hydration identity for a client-backed window. @@ -31,7 +31,7 @@ Hydration identity for a client-backed window. optional dependencies: readonly unknown[]; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:84](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L84) +Defined in: [packages/db/src/live-query-window-binding.ts:83](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L83) The query input's identity dependencies. @@ -43,7 +43,7 @@ The query input's identity dependencies. initialPageParam: number; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:40](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L40) +Defined in: [packages/db/src/live-query-window-binding.ts:41](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L41) First result-page label, not a server cursor or remote offset. @@ -59,7 +59,7 @@ First result-page label, not a server cursor or remote offset. input: unknown; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:82](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L82) +Defined in: [packages/db/src/live-query-window-binding.ts:81](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L81) A supplied live-query Collection, or a callback that returns the query. The binding calls the callback only when it compiles a new window @@ -73,7 +73,7 @@ collection, except in `always` mode, where it calls it on every update. pageSize: number; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:38](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L38) +Defined in: [packages/db/src/live-query-window-binding.ts:39](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L39) #### Inherited from @@ -87,7 +87,7 @@ Defined in: [packages/db/src/live-query-window-binding.ts:38](https://github.com optional queryKey: LiveQueryKey; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:89](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L89) +Defined in: [packages/db/src/live-query-window-binding.ts:88](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L88) *** @@ -97,7 +97,7 @@ Defined in: [packages/db/src/live-query-window-binding.ts:89](https://github.com recompile: LiveQueryWindowRecompile; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:90](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L90) +Defined in: [packages/db/src/live-query-window-binding.ts:89](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L89) *** @@ -107,6 +107,6 @@ Defined in: [packages/db/src/live-query-window-binding.ts:90](https://github.com optional scope: unknown; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:86](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L86) +Defined in: [packages/db/src/live-query-window-binding.ts:85](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L85) Context compared by reference, such as the `DbClient` a query binds to. diff --git a/docs/reference/interfaces/LocalOnlyCollectionConfig.md b/docs/reference/interfaces/LocalOnlyCollectionConfig.md index 667f16a4fd..16316eb35c 100644 --- a/docs/reference/interfaces/LocalOnlyCollectionConfig.md +++ b/docs/reference/interfaces/LocalOnlyCollectionConfig.md @@ -39,7 +39,7 @@ The type of the key returned by `getKey` optional autoIndex: "eager" | "off"; ``` -Defined in: [packages/db/src/types.ts:886](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L886) +Defined in: [packages/db/src/types.ts:937](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L937) Auto-indexing mode for the collection. When enabled, indexes will be automatically created for simple where expressions. @@ -68,7 +68,7 @@ When enabled, indexes will be automatically created for simple where expressions optional compare: (x, y) => number; ``` -Defined in: [packages/db/src/types.ts:911](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L911) +Defined in: [packages/db/src/types.ts:962](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L962) Optional function to compare two items. This is used to order the items in the collection. @@ -114,7 +114,7 @@ Omit.compare optional defaultIndexType: IndexConstructor; ``` -Defined in: [packages/db/src/types.ts:900](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L900) +Defined in: [packages/db/src/types.ts:951](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L951) Default index type to use when creating indexes without an explicit type. Required for auto-indexing. Import from '@tanstack/db'. @@ -144,7 +144,7 @@ Omit.defaultIndexType optional defaultStringCollation: StringCollationConfig; ``` -Defined in: [packages/db/src/types.ts:1106](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1106) +Defined in: [packages/db/src/types.ts:1137](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1137) Specifies how to compare data in the collection. This should be configured to match data ordering on the backend. @@ -165,7 +165,7 @@ Omit.defaultStringCollation getKey: (item) => TKey; ``` -Defined in: [packages/db/src/types.ts:856](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L856) +Defined in: [packages/db/src/types.ts:898](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L898) Function to extract the ID from an object This is required for update/delete operations which now only accept IDs @@ -205,7 +205,7 @@ Omit.getKey optional id: string; ``` -Defined in: [packages/db/src/types.ts:845](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L845) +Defined in: [packages/db/src/types.ts:887](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L887) #### Inherited from @@ -219,25 +219,23 @@ Defined in: [packages/db/src/types.ts:845](https://github.com/TanStack/db/blob/m optional initialData: T[]; ``` -Defined in: [packages/db/src/local-only.ts:36](https://github.com/TanStack/db/blob/main/packages/db/src/local-only.ts#L36) +Defined in: [packages/db/src/local-only.ts:37](https://github.com/TanStack/db/blob/main/packages/db/src/local-only.ts#L37) -Optional initial data to populate the collection with on creation -This data will be applied during the initial sync process +Optional initial data to populate the collection with on creation. +It loads when the Collection starts empty: at creation, or after +cleanup. `reload()` keeps the rows, including the user's writes. *** ### onDelete? ```ts -optional onDelete: - | DeleteMutationFn -| DeleteMutationFn; +optional onDelete: DeleteMutationFn; ``` -Defined in: [packages/db/src/types.ts:1095](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1095) +Defined in: [packages/db/src/types.ts:1129](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1129) Optional asynchronous handler function called before a delete operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -256,8 +254,6 @@ onDelete: async ({ transaction, collection }) => { await api.deleteTodos(keysToDelete) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -308,15 +304,12 @@ Omit.onDelete ### onInsert? ```ts -optional onInsert: - | InsertMutationFn -| InsertMutationFn; +optional onInsert: InsertMutationFn; ``` -Defined in: [packages/db/src/types.ts:974](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L974) +Defined in: [packages/db/src/types.ts:1021](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1021) Optional asynchronous handler function called before an insert operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -335,8 +328,6 @@ onInsert: async ({ transaction, collection }) => { await api.createTodo(newItem) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -357,7 +348,6 @@ onInsert: async ({ transaction, collection }) => { await api.createTodos(items) // Refetch to get updated data from server await collection.utils.refetch() - return { refetch: false } } ``` @@ -385,15 +375,12 @@ Omit.onInsert ### onUpdate? ```ts -optional onUpdate: - | UpdateMutationFn -| UpdateMutationFn; +optional onUpdate: UpdateMutationFn; ``` -Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) +Defined in: [packages/db/src/types.ts:1076](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1076) Optional asynchronous handler function called before an update operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -413,8 +400,6 @@ onUpdate: async ({ transaction, collection }) => { await api.updateTodo(mutation.original.id, changes) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -437,7 +422,6 @@ onUpdate: async ({ transaction, collection }) => { })) await api.updateTodos(updates) await collection.utils.refetch() - return { refetch: false } } ``` @@ -469,7 +453,7 @@ Omit.onUpdate optional schema: TSchema; ``` -Defined in: [packages/db/src/types.ts:846](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L846) +Defined in: [packages/db/src/types.ts:888](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L888) #### Inherited from @@ -485,7 +469,7 @@ Omit.schema optional syncMode: SyncMode; ``` -Defined in: [packages/db/src/types.ts:920](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L920) +Defined in: [packages/db/src/types.ts:971](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L971) The mode of sync to use for the collection. @@ -511,7 +495,7 @@ The exact implementation of the sync mode is up to the sync implementation. optional utils: LocalOnlyCollectionUtils; ``` -Defined in: [packages/db/src/types.ts:1108](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1108) +Defined in: [packages/db/src/types.ts:1139](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1139) #### Inherited from diff --git a/docs/reference/interfaces/LocalOnlyCollectionUtils.md b/docs/reference/interfaces/LocalOnlyCollectionUtils.md index 4ca14a5b68..dd84455f9a 100644 --- a/docs/reference/interfaces/LocalOnlyCollectionUtils.md +++ b/docs/reference/interfaces/LocalOnlyCollectionUtils.md @@ -3,7 +3,7 @@ id: LocalOnlyCollectionUtils title: LocalOnlyCollectionUtils --- -Defined in: [packages/db/src/local-only.ts:42](https://github.com/TanStack/db/blob/main/packages/db/src/local-only.ts#L42) +Defined in: [packages/db/src/local-only.ts:43](https://github.com/TanStack/db/blob/main/packages/db/src/local-only.ts#L43) Local-only collection utilities type @@ -25,7 +25,7 @@ Local-only collection utilities type acceptMutations: (transaction) => void; ``` -Defined in: [packages/db/src/local-only.ts:60](https://github.com/TanStack/db/blob/main/packages/db/src/local-only.ts#L60) +Defined in: [packages/db/src/local-only.ts:61](https://github.com/TanStack/db/blob/main/packages/db/src/local-only.ts#L61) Accepts mutations from a transaction that belong to this collection and persists them. This should be called in your transaction's mutationFn to persist local-only data. diff --git a/docs/reference/interfaces/LocalStorageCollectionConfig.md b/docs/reference/interfaces/LocalStorageCollectionConfig.md index 1ce9a03944..0d6095c717 100644 --- a/docs/reference/interfaces/LocalStorageCollectionConfig.md +++ b/docs/reference/interfaces/LocalStorageCollectionConfig.md @@ -39,7 +39,7 @@ The type of the key returned by `getKey` optional autoIndex: "eager" | "off"; ``` -Defined in: [packages/db/src/types.ts:886](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L886) +Defined in: [packages/db/src/types.ts:937](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L937) Auto-indexing mode for the collection. When enabled, indexes will be automatically created for simple where expressions. @@ -68,7 +68,7 @@ When enabled, indexes will be automatically created for simple where expressions optional compare: (x, y) => number; ``` -Defined in: [packages/db/src/types.ts:911](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L911) +Defined in: [packages/db/src/types.ts:962](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L962) Optional function to compare two items. This is used to order the items in the collection. @@ -112,7 +112,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime() optional defaultIndexType: IndexConstructor; ``` -Defined in: [packages/db/src/types.ts:900](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L900) +Defined in: [packages/db/src/types.ts:951](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L951) Default index type to use when creating indexes without an explicit type. Required for auto-indexing. Import from '@tanstack/db'. @@ -140,7 +140,7 @@ const collection = createCollection({ optional defaultStringCollation: StringCollationConfig; ``` -Defined in: [packages/db/src/types.ts:1106](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1106) +Defined in: [packages/db/src/types.ts:1137](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1137) Specifies how to compare data in the collection. This should be configured to match data ordering on the backend. @@ -159,13 +159,22 @@ E.g., when using the Electric DB collection these options optional gcTime: number; ``` -Defined in: [packages/db/src/types.ts:865](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L865) +Defined in: [packages/db/src/types.ts:916](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L916) Time in milliseconds after which the collection will be garbage collected when it has no active subscribers. Defaults to 5 minutes (300000ms). -Sync started without subscribers gets a minimum 50ms grace period. +Sync started without subscribers gets a minimum 50ms handoff grace period +until a subscriber attaches. After the last subscriber leaves, gcTime +applies without that startup minimum. Pending preloads retain the collection until they settle. Preloading ready -data refreshes the retention period. A non-positive or non-finite value +data refreshes the retention period. A persisting transaction that touches +the collection also retains it, and the period starts again when the last +one completes or fails, preserving any remaining startup grace. Pending +manual transactions do not retain it; keep a subscription for draft +visibility until commit or rollback. Rolling +back a manual transaction that stayed pending preserves the existing GC +deadline. Cleanup runs at a host idle opportunity after the delay. +A non-positive or non-finite value disables automatic garbage collection. #### Inherited from @@ -180,7 +189,7 @@ disables automatic garbage collection. getKey: (item) => TKey; ``` -Defined in: [packages/db/src/types.ts:856](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L856) +Defined in: [packages/db/src/types.ts:898](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L898) Function to extract the ID from an object This is required for update/delete operations which now only accept IDs @@ -218,7 +227,7 @@ getKey: (item) => item.uuid optional id: string; ``` -Defined in: [packages/db/src/types.ts:845](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L845) +Defined in: [packages/db/src/types.ts:887](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L887) #### Inherited from @@ -229,15 +238,12 @@ Defined in: [packages/db/src/types.ts:845](https://github.com/TanStack/db/blob/m ### onDelete? ```ts -optional onDelete: - | DeleteMutationFn -| DeleteMutationFn; +optional onDelete: DeleteMutationFn; ``` -Defined in: [packages/db/src/types.ts:1095](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1095) +Defined in: [packages/db/src/types.ts:1129](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1129) Optional asynchronous handler function called before a delete operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -256,8 +262,6 @@ onDelete: async ({ transaction, collection }) => { await api.deleteTodos(keysToDelete) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -306,15 +310,12 @@ onDelete: async ({ transaction, collection }) => { ### onInsert? ```ts -optional onInsert: - | InsertMutationFn -| InsertMutationFn; +optional onInsert: InsertMutationFn; ``` -Defined in: [packages/db/src/types.ts:974](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L974) +Defined in: [packages/db/src/types.ts:1021](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1021) Optional asynchronous handler function called before an insert operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -333,8 +334,6 @@ onInsert: async ({ transaction, collection }) => { await api.createTodo(newItem) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -355,7 +354,6 @@ onInsert: async ({ transaction, collection }) => { await api.createTodos(items) // Refetch to get updated data from server await collection.utils.refetch() - return { refetch: false } } ``` @@ -381,15 +379,12 @@ onInsert: async ({ transaction, collection }) => { ### onUpdate? ```ts -optional onUpdate: - | UpdateMutationFn -| UpdateMutationFn; +optional onUpdate: UpdateMutationFn; ``` -Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) +Defined in: [packages/db/src/types.ts:1076](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1076) Optional asynchronous handler function called before an update operation -Returning a value is deprecated; coordinate synchronization through collection utilities instead. #### Examples @@ -409,8 +404,6 @@ onUpdate: async ({ transaction, collection }) => { await api.updateTodo(mutation.original.id, changes) // Trigger refetch to sync server state await collection.utils.refetch() - // Prevent the pre-1.0 compatibility wrapper from refetching again. - return { refetch: false } } ``` @@ -433,7 +426,6 @@ onUpdate: async ({ transaction, collection }) => { })) await api.updateTodos(updates) await collection.utils.refetch() - return { refetch: false } } ``` @@ -476,7 +468,7 @@ Defaults to JSON optional schema: TSchema; ``` -Defined in: [packages/db/src/types.ts:846](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L846) +Defined in: [packages/db/src/types.ts:888](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L888) #### Inherited from @@ -490,7 +482,7 @@ Defined in: [packages/db/src/types.ts:846](https://github.com/TanStack/db/blob/m optional startSync: boolean; ``` -Defined in: [packages/db/src/types.ts:876](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L876) +Defined in: [packages/db/src/types.ts:927](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L927) Whether to eagerly start syncing on collection creation. When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches. @@ -555,7 +547,7 @@ The key to use for storing the collection data in localStorage/sessionStorage optional syncMode: SyncMode; ``` -Defined in: [packages/db/src/types.ts:920](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L920) +Defined in: [packages/db/src/types.ts:971](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L971) The mode of sync to use for the collection. @@ -581,7 +573,7 @@ The exact implementation of the sync mode is up to the sync implementation. optional utils: UtilsRecord; ``` -Defined in: [packages/db/src/types.ts:1108](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1108) +Defined in: [packages/db/src/types.ts:1139](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1139) #### Inherited from diff --git a/docs/reference/interfaces/OperationConfig.md b/docs/reference/interfaces/OperationConfig.md index db8676559f..9980106af6 100644 --- a/docs/reference/interfaces/OperationConfig.md +++ b/docs/reference/interfaces/OperationConfig.md @@ -3,7 +3,7 @@ id: OperationConfig title: OperationConfig --- -Defined in: [packages/db/src/types.ts:672](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L672) +Defined in: [packages/db/src/types.ts:712](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L712) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/db/src/types.ts:672](https://github.com/TanStack/db/blob/m optional metadata: Record; ``` -Defined in: [packages/db/src/types.ts:673](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L673) +Defined in: [packages/db/src/types.ts:713](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L713) *** @@ -23,6 +23,6 @@ Defined in: [packages/db/src/types.ts:673](https://github.com/TanStack/db/blob/m optional optimistic: boolean; ``` -Defined in: [packages/db/src/types.ts:675](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L675) +Defined in: [packages/db/src/types.ts:715](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L715) Whether to apply optimistic updates immediately. Defaults to true. diff --git a/docs/reference/interfaces/SubscribeChangesOptions.md b/docs/reference/interfaces/SubscribeChangesOptions.md index 73f9e4aca4..ec6cb91b39 100644 --- a/docs/reference/interfaces/SubscribeChangesOptions.md +++ b/docs/reference/interfaces/SubscribeChangesOptions.md @@ -3,7 +3,7 @@ id: SubscribeChangesOptions title: SubscribeChangesOptions --- -Defined in: [packages/db/src/types.ts:1207](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1207) +Defined in: [packages/db/src/types.ts:1238](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1238) Options for subscribing to collection changes @@ -25,7 +25,7 @@ Options for subscribing to collection changes optional deferAcquisition: boolean; ``` -Defined in: [packages/db/src/types.ts:1238](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1238) +Defined in: [packages/db/src/types.ts:1269](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1269) **`Internal`** @@ -43,7 +43,7 @@ subscriber or a preload in its current sync run. optional includeInitialState: boolean; ``` -Defined in: [packages/db/src/types.ts:1212](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1212) +Defined in: [packages/db/src/types.ts:1243](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1243) Whether to include the current state as initial changes @@ -55,7 +55,7 @@ Whether to include the current state as initial changes optional limit: number; ``` -Defined in: [packages/db/src/types.ts:1260](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1260) +Defined in: [packages/db/src/types.ts:1291](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1291) **`Internal`** @@ -69,7 +69,7 @@ Optional limit to include in loadSubset for query-specific cache keys. optional onLoadSubsetError: (event) => void; ``` -Defined in: [packages/db/src/types.ts:1268](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1268) +Defined in: [packages/db/src/types.ts:1299](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1299) **`Internal`** @@ -93,7 +93,7 @@ Receives subset-load failures scoped to this subscription. optional onLoadSubsetResult: (result) => void; ``` -Defined in: [packages/db/src/types.ts:1266](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1266) +Defined in: [packages/db/src/types.ts:1297](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1297) **`Internal`** @@ -118,7 +118,7 @@ Allows the caller to directly track the loading promise for isReady status. optional onStatusChange: (event) => void; ``` -Defined in: [packages/db/src/types.ts:1250](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1250) +Defined in: [packages/db/src/types.ts:1281](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1281) **`Internal`** @@ -143,7 +143,7 @@ Registered BEFORE any snapshot is requested, ensuring no status transitions are optional orderBy: OrderBy; ``` -Defined in: [packages/db/src/types.ts:1255](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1255) +Defined in: [packages/db/src/types.ts:1286](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1286) **`Internal`** @@ -157,7 +157,7 @@ Optional orderBy to include in loadSubset for query-specific cache keys. optional owner: CollectionDependent; ``` -Defined in: [packages/db/src/types.ts:1244](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1244) +Defined in: [packages/db/src/types.ts:1275](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1275) **`Internal`** @@ -172,7 +172,7 @@ The live query or Effect this subscription reads for, so optional truncateReplayPublication: object; ``` -Defined in: [packages/db/src/types.ts:1270](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1270) +Defined in: [packages/db/src/types.ts:1301](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1301) **`Internal`** @@ -181,39 +181,48 @@ Lets a live-query graph retain its last publication during replay. #### fail()? ```ts -readonly optional fail: (error) => void; +readonly optional fail: (errors) => void; ``` -The replay could not load every active demand again. +The replay could not load every active demand again: its failures, in failure order. ##### Parameters -###### error +###### errors -`Error` +`Error`[] ##### Returns `void` -#### holdsDemand()? +#### siblingReplays() ```ts -readonly optional holdsDemand: () => boolean; +readonly siblingReplays: () => Promise | undefined; ``` -The live query still holds logical demand. +The replays of the graph's other subscriptions to this collection that +still load. They share one barrier, so this replay waits for them. ##### Returns -`boolean` +`Promise`\<`unknown`\> \| `undefined` #### start() ```ts -readonly start: () => void; +readonly start: (retired) => void; ``` +`retired`: a reload retired the sync run, and no truncate came. + +##### Parameters + +###### retired + +`boolean` + ##### Returns `void` @@ -236,7 +245,7 @@ readonly succeed: () => void; optional where: (row) => any; ``` -Defined in: [packages/db/src/types.ts:1227](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1227) +Defined in: [packages/db/src/types.ts:1258](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1258) Callback function for filtering changes using a row proxy. The callback receives a proxy object that records property access, @@ -270,6 +279,6 @@ collection.subscribeChanges(callback, { optional whereExpression: BasicExpression; ``` -Defined in: [packages/db/src/types.ts:1229](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1229) +Defined in: [packages/db/src/types.ts:1260](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1260) Pre-compiled expression for filtering changes diff --git a/docs/reference/interfaces/SubscribeChangesSnapshotOptions.md b/docs/reference/interfaces/SubscribeChangesSnapshotOptions.md index 24f199ca4f..9b7b53df3c 100644 --- a/docs/reference/interfaces/SubscribeChangesSnapshotOptions.md +++ b/docs/reference/interfaces/SubscribeChangesSnapshotOptions.md @@ -3,7 +3,7 @@ id: SubscribeChangesSnapshotOptions title: SubscribeChangesSnapshotOptions --- -Defined in: [packages/db/src/types.ts:1280](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1280) +Defined in: [packages/db/src/types.ts:1315](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1315) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/db/src/types.ts:1280](https://github.com/TanStack/db/blob/ optional deferAcquisition: boolean; ``` -Defined in: [packages/db/src/types.ts:1238](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1238) +Defined in: [packages/db/src/types.ts:1269](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1269) **`Internal`** @@ -49,7 +49,7 @@ subscriber or a preload in its current sync run. optional limit: number; ``` -Defined in: [packages/db/src/types.ts:1285](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1285) +Defined in: [packages/db/src/types.ts:1320](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1320) **`Internal`** @@ -67,7 +67,7 @@ Optional limit to include in loadSubset for query-specific cache keys. optional onLoadSubsetError: (event) => void; ``` -Defined in: [packages/db/src/types.ts:1268](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1268) +Defined in: [packages/db/src/types.ts:1299](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1299) **`Internal`** @@ -97,7 +97,7 @@ Omit.onLoadSubsetError optional onLoadSubsetResult: (result) => void; ``` -Defined in: [packages/db/src/types.ts:1266](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1266) +Defined in: [packages/db/src/types.ts:1297](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1297) **`Internal`** @@ -128,7 +128,7 @@ Omit.onLoadSubsetResult optional onStatusChange: (event) => void; ``` -Defined in: [packages/db/src/types.ts:1250](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1250) +Defined in: [packages/db/src/types.ts:1281](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1281) **`Internal`** @@ -159,7 +159,7 @@ Omit.onStatusChange optional orderBy: OrderBy; ``` -Defined in: [packages/db/src/types.ts:1284](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1284) +Defined in: [packages/db/src/types.ts:1319](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1319) **`Internal`** @@ -177,7 +177,7 @@ Optional orderBy to include in loadSubset for query-specific cache keys. optional owner: CollectionDependent; ``` -Defined in: [packages/db/src/types.ts:1244](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1244) +Defined in: [packages/db/src/types.ts:1275](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1275) **`Internal`** @@ -196,7 +196,7 @@ The live query or Effect this subscription reads for, so optional truncateReplayPublication: object; ``` -Defined in: [packages/db/src/types.ts:1270](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1270) +Defined in: [packages/db/src/types.ts:1301](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1301) **`Internal`** @@ -205,39 +205,48 @@ Lets a live-query graph retain its last publication during replay. #### fail()? ```ts -readonly optional fail: (error) => void; +readonly optional fail: (errors) => void; ``` -The replay could not load every active demand again. +The replay could not load every active demand again: its failures, in failure order. ##### Parameters -###### error +###### errors -`Error` +`Error`[] ##### Returns `void` -#### holdsDemand()? +#### siblingReplays() ```ts -readonly optional holdsDemand: () => boolean; +readonly siblingReplays: () => Promise | undefined; ``` -The live query still holds logical demand. +The replays of the graph's other subscriptions to this collection that +still load. They share one barrier, so this replay waits for them. ##### Returns -`boolean` +`Promise`\<`unknown`\> \| `undefined` #### start() ```ts -readonly start: () => void; +readonly start: (retired) => void; ``` +`retired`: a reload retired the sync run, and no truncate came. + +##### Parameters + +###### retired + +`boolean` + ##### Returns `void` @@ -266,7 +275,7 @@ Omit.truncateReplayPublication optional where: (row) => any; ``` -Defined in: [packages/db/src/types.ts:1227](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1227) +Defined in: [packages/db/src/types.ts:1258](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1258) Callback function for filtering changes using a row proxy. The callback receives a proxy object that records property access, @@ -306,7 +315,7 @@ Omit.where optional whereExpression: BasicExpression; ``` -Defined in: [packages/db/src/types.ts:1229](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1229) +Defined in: [packages/db/src/types.ts:1260](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1260) Pre-compiled expression for filtering changes diff --git a/docs/reference/interfaces/SyncConfig.md b/docs/reference/interfaces/SyncConfig.md index d16c6df921..279c80fcf0 100644 --- a/docs/reference/interfaces/SyncConfig.md +++ b/docs/reference/interfaces/SyncConfig.md @@ -3,7 +3,7 @@ id: SyncConfig title: SyncConfig --- -Defined in: [packages/db/src/types.ts:445](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L445) +Defined in: [packages/db/src/types.ts:446](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L446) ## Type Parameters @@ -23,7 +23,7 @@ Defined in: [packages/db/src/types.ts:445](https://github.com/TanStack/db/blob/m optional exportSyncMeta: () => unknown; ``` -Defined in: [packages/db/src/types.ts:520](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L520) +Defined in: [packages/db/src/types.ts:532](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L532) Export adapter-specific metadata that lets hydration/persistence resume sync. The payload shape is owned by the adapter. @@ -40,7 +40,7 @@ The payload shape is owned by the adapter. optional getSyncMetadata: () => Record; ``` -Defined in: [packages/db/src/types.ts:514](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L514) +Defined in: [packages/db/src/types.ts:526](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L526) Get the sync metadata for insert operations @@ -58,7 +58,7 @@ Record containing relation information optional importSyncMeta: (meta) => void; ``` -Defined in: [packages/db/src/types.ts:525](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L525) +Defined in: [packages/db/src/types.ts:537](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L537) Import adapter-specific metadata produced by exportSyncMeta. @@ -80,7 +80,7 @@ Import adapter-specific metadata produced by exportSyncMeta. optional mergeSyncMeta: (current, incoming) => unknown; ``` -Defined in: [packages/db/src/types.ts:530](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L530) +Defined in: [packages/db/src/types.ts:542](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L542) Merge two adapter-specific metadata payloads during hydration. @@ -106,7 +106,7 @@ Merge two adapter-specific metadata payloads during hydration. optional rowUpdateMode: "full" | "partial"; ``` -Defined in: [packages/db/src/types.ts:539](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L539) +Defined in: [packages/db/src/types.ts:551](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L551) The row update mode used to sync to the collection. @@ -130,7 +130,7 @@ sync: (params) => | SyncConfigRes; ``` -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:450](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L450) #### Parameters @@ -140,10 +140,11 @@ Defined in: [packages/db/src/types.ts:449](https://github.com/TanStack/db/blob/m (`options?`) => `void` -Begin a new sync transaction. `direct: true` marks a direct write: an -edit of the rows on screen, not part of the sync run's snapshot. During -a reload it applies to the kept rows, and the reload's replacement of -every row waits for the run's next transaction. +Begin a new sync transaction. Its writes apply on the rows the +Collection holds, also during a reload. `snapshot: true` declares that +the transaction carries every row: its commit replaces every synced +row, as `truncate({ markReady: false })` at its start does. A reload's +new run replaces the kept rows only with a snapshot or `truncate()`. ###### collection @@ -186,7 +187,9 @@ coalesced. Do not call it for results that answer a `loadSubset` call. () => `void` -Signal that a usable initial snapshot is available for this attempt. +Signal that the sync run's initial data is available. During a reload +it completes the reload and keeps the rows unless a snapshot replaced +them. A second call in the run, or one after `fail()`, does nothing. ###### metadata? @@ -197,16 +200,22 @@ Signal that a usable initial snapshot is available for this attempt. (`error`) => `void` Report a problem after the first ready while the sync adapter keeps -trying. It shows as the node's `failureReason`; the status and rows do -not change. Throws before the first ready and after `fail()`. +trying. It shows as the node's `failureReason` and adds a failure to its +`errors`; the status and rows do not change. One error value is one +failure: reporting a value already listed changes nothing, and that +failure keeps its place and its `at`. Throws before the first ready and +after `fail()`. ###### reportHealthy -() => `void` +(`error?`) => `void` -Sync works again: clears a `failureReason`. With nothing to clear it does -nothing, so it can follow every commit. Throws before the first ready -and after `fail()`. +Sync works again. With no `error`, clears the `failureReason`. With an +`error`, removes only the failure whose cause is that value, for +example one of several requests that recovered; the `failureReason` +then shows the newest failure left, and clears once none is left. With +nothing to clear or remove it does nothing, so it can follow every +commit. Throws before the first ready and after `fail()`. ###### truncate diff --git a/docs/reference/interfaces/SyncMetadataApi.md b/docs/reference/interfaces/SyncMetadataApi.md index 1fd98864d8..6d270b299b 100644 --- a/docs/reference/interfaces/SyncMetadataApi.md +++ b/docs/reference/interfaces/SyncMetadataApi.md @@ -3,7 +3,7 @@ id: SyncMetadataApi title: SyncMetadataApi --- -Defined in: [packages/db/src/types.ts:542](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L542) +Defined in: [packages/db/src/types.ts:554](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L554) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/db/src/types.ts:542](https://github.com/TanStack/db/blob/m collection: object; ``` -Defined in: [packages/db/src/types.ts:550](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L550) +Defined in: [packages/db/src/types.ts:562](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L562) #### delete() @@ -99,7 +99,7 @@ persistence: | null; ``` -Defined in: [packages/db/src/types.ts:568](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L568) +Defined in: [packages/db/src/types.ts:580](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L580) **`Internal`** @@ -119,7 +119,7 @@ invalid. row: object; ``` -Defined in: [packages/db/src/types.ts:545](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L545) +Defined in: [packages/db/src/types.ts:557](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L557) #### delete() diff --git a/docs/reference/interfaces/Transaction.md b/docs/reference/interfaces/Transaction.md index f5b8f65cf6..d95ab512c8 100644 --- a/docs/reference/interfaces/Transaction.md +++ b/docs/reference/interfaces/Transaction.md @@ -3,7 +3,7 @@ id: Transaction title: Transaction --- -Defined in: [packages/db/src/transactions.ts:365](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L365) +Defined in: [packages/db/src/transactions.ts:350](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L350) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/db/src/transactions.ts:365](https://github.com/TanStack/db autoCommit: boolean; ``` -Defined in: [packages/db/src/transactions.ts:394](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L394) +Defined in: [packages/db/src/transactions.ts:362](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L362) *** @@ -29,7 +29,7 @@ Defined in: [packages/db/src/transactions.ts:394](https://github.com/TanStack/db readonly collections: Set>; ``` -Defined in: [packages/db/src/transactions.ts:374](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L374) +Defined in: [packages/db/src/transactions.ts:359](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L359) Every Collection that has tracked this transaction. Settlement recomputes each of them, including one whose mutations merged away. @@ -42,7 +42,7 @@ each of them, including one whose mutations merged away. createdAt: Date; ``` -Defined in: [packages/db/src/transactions.ts:395](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L395) +Defined in: [packages/db/src/transactions.ts:363](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L363) *** @@ -52,7 +52,7 @@ Defined in: [packages/db/src/transactions.ts:395](https://github.com/TanStack/db optional error: object; ``` -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:366](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L366) #### error @@ -74,34 +74,7 @@ message: string; id: string; ``` -Defined in: [packages/db/src/transactions.ts:366](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L366) - -*** - -### ~~isPersisted~~ - -```ts -isPersisted: Deferred>; -``` - -Defined in: [packages/db/src/transactions.ts:393](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L393) - -Deferred that settles when this transaction settles. - -Await `when('settled')` instead. This legacy promise resolves -when the transaction completes successfully and rejects if the transaction -fails or is rolled back. - -For non-empty commits, the mutation function is the normal settlement -boundary. This does not inherently prove that a backend has uploaded, -confirmed, or read back the write unless the mutation function waits for -that backend observation before returning. An adapter can also register -commit work during the mutation function; settlement waits for that work. - -#### Deprecated - -Use `when('settled')` instead. This alias will be removed in -the 1.0 RC. +Defined in: [packages/db/src/transactions.ts:351](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L351) *** @@ -111,7 +84,7 @@ the 1.0 RC. metadata: Record; ``` -Defined in: [packages/db/src/transactions.ts:397](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L397) +Defined in: [packages/db/src/transactions.ts:365](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L365) *** @@ -121,7 +94,7 @@ Defined in: [packages/db/src/transactions.ts:397](https://github.com/TanStack/db mutationFn: MutationFn; ``` -Defined in: [packages/db/src/transactions.ts:368](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L368) +Defined in: [packages/db/src/transactions.ts:353](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L353) *** @@ -131,7 +104,7 @@ Defined in: [packages/db/src/transactions.ts:368](https://github.com/TanStack/db mutations: PendingMutation>[]; ``` -Defined in: [packages/db/src/transactions.ts:369](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L369) +Defined in: [packages/db/src/transactions.ts:354](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L354) *** @@ -141,7 +114,7 @@ Defined in: [packages/db/src/transactions.ts:369](https://github.com/TanStack/db sequenceNumber: number; ``` -Defined in: [packages/db/src/transactions.ts:396](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L396) +Defined in: [packages/db/src/transactions.ts:364](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L364) *** @@ -151,7 +124,7 @@ Defined in: [packages/db/src/transactions.ts:396](https://github.com/TanStack/db state: TransactionState; ``` -Defined in: [packages/db/src/transactions.ts:367](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L367) +Defined in: [packages/db/src/transactions.ts:352](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L352) ## Methods @@ -161,7 +134,7 @@ Defined in: [packages/db/src/transactions.ts:367](https://github.com/TanStack/db applyMutations(mutations): void; ``` -Defined in: [packages/db/src/transactions.ts:590](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L590) +Defined in: [packages/db/src/transactions.ts:566](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L566) Apply new mutations to this transaction, intelligently merging with existing mutations @@ -198,7 +171,7 @@ Array of new mutations to apply commit(): Promise>; ``` -Defined in: [packages/db/src/transactions.ts:770](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L770) +Defined in: [packages/db/src/transactions.ts:745](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L745) Commit the transaction and execute the mutation function @@ -257,7 +230,7 @@ console.log(tx.state) // "completed" or "failed" compareCreatedAt(other): number; ``` -Defined in: [packages/db/src/transactions.ts:850](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L850) +Defined in: [packages/db/src/transactions.ts:817](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L817) Compare two transactions by their createdAt time and sequence number in order to sort them in the order they were created. @@ -278,13 +251,31 @@ The other transaction to compare to *** +### completeWithoutCommit() + +```ts +completeWithoutCommit(): void; +``` + +Defined in: [packages/db/src/transactions.ts:411](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L411) + +**`Internal`** + +Complete a transaction whose work was already applied outside commit(). + +#### Returns + +`void` + +*** + ### mutate() ```ts mutate(callback): Transaction; ``` -Defined in: [packages/db/src/transactions.ts:499](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L499) +Defined in: [packages/db/src/transactions.ts:475](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L475) Execute collection operations within this transaction @@ -361,7 +352,7 @@ await tx.commit() rollback(config?): Transaction; ``` -Defined in: [packages/db/src/transactions.ts:665](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L665) +Defined in: [packages/db/src/transactions.ts:638](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L638) Rollback the transaction and any conflicting transactions @@ -432,7 +423,7 @@ try { setState(newState): void; ``` -Defined in: [packages/db/src/transactions.ts:441](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L441) +Defined in: [packages/db/src/transactions.ts:417](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L417) #### Parameters @@ -449,10 +440,10 @@ Defined in: [packages/db/src/transactions.ts:441](https://github.com/TanStack/db ### touchCollection() ```ts -touchCollection(): void; +touchCollection(releasedHold): void; ``` -Defined in: [packages/db/src/transactions.ts:710](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L710) +Defined in: [packages/db/src/transactions.ts:684](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L684) Tell every Collection that tracked this transaction that it changed. A failure in one Collection must not leave the others showing this @@ -460,6 +451,12 @@ transaction's settled optimistic state, so each one recomputes before the first error is thrown. A settled transaction then empties its set of tracking Collections. Its mutations still name their Collection. +#### Parameters + +##### releasedHold + +`boolean` = `false` + #### Returns `void` @@ -472,7 +469,7 @@ tracking Collections. Its mutations still name their Collection. when(_state): Promise>; ``` -Defined in: [packages/db/src/transactions.ts:437](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L437) +Defined in: [packages/db/src/transactions.ts:406](https://github.com/TanStack/db/blob/main/packages/db/src/transactions.ts#L406) Wait for this transaction to complete successfully or fail. diff --git a/docs/reference/interfaces/VirtualRowProps.md b/docs/reference/interfaces/VirtualRowProps.md index 39084c557a..bc8bea77ef 100644 --- a/docs/reference/interfaces/VirtualRowProps.md +++ b/docs/reference/interfaces/VirtualRowProps.md @@ -3,12 +3,9 @@ id: VirtualRowProps title: VirtualRowProps --- -Defined in: [packages/db/src/virtual-props.ts:76](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L76) +Defined in: [packages/db/src/virtual-props.ts:78](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L78) -Virtual properties recognized on TanStack DB rows. The new -`$hasPendingWrites` field is optional here so legacy four-field rows accepted -by `hasVirtualProps` remain assignable. Rows returned by collections use -`WithVirtualProps`, which requires it. +Virtual properties recognized on TanStack DB rows. These properties are: - Computed (not stored in the data model) @@ -16,6 +13,11 @@ These properties are: - Available in queries (WHERE, ORDER BY, SELECT) - Included when spreading rows (`...user`) +Structured whole-row selections and spreads retain source metadata. +A functional selection retains it only when returning a source row directly. +New functional objects and other projections receive the output Collection's +metadata. Selected virtual names cannot change that attribution. + ## Examples ```typescript @@ -54,19 +56,20 @@ The type of the row's key (string or number) readonly $collectionId: string; ``` -Defined in: [packages/db/src/virtual-props.ts:133](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L133) +Defined in: [packages/db/src/virtual-props.ts:116](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L116) The ID of the source collection this row originated from. In joins, this can help identify which collection each row came from. -For live query collections, this is the ID of the upstream collection. +Whole-row live queries preserve the upstream Collection's ID. Projected +row roots otherwise use the live-query Collection's ID. *** -### $hasPendingWrites? +### $hasPendingWrites ```ts -readonly optional $hasPendingWrites: boolean; +readonly $hasPendingWrites: boolean; ``` Defined in: [packages/db/src/virtual-props.ts:87](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L87) @@ -74,9 +77,7 @@ Defined in: [packages/db/src/virtual-props.ts:87](https://github.com/TanStack/db Whether this row currently has pending local optimistic writes. This describes the row's local optimistic state, not backend upload or -acknowledgement. It is always `false` for local-only collections. It is -optional only for compatibility with legacy rows; collection-published -rows always provide it. +acknowledgement. It is always `false` for local-only collections. *** @@ -86,7 +87,7 @@ rows always provide it. readonly $key: TKey; ``` -Defined in: [packages/db/src/virtual-props.ts:125](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L125) +Defined in: [packages/db/src/virtual-props.ts:107](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L107) The row's key (primary identifier). @@ -101,7 +102,7 @@ Useful when you need the key in projections or computations. readonly $origin: VirtualOrigin; ``` -Defined in: [packages/db/src/virtual-props.ts:117](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L117) +Defined in: [packages/db/src/virtual-props.ts:99](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L99) Collection attribution for this row's current value. `'local'` covers optimistic rows and attributed source writes; `'remote'` covers source @@ -109,32 +110,5 @@ writes without local attribution. See [VirtualOrigin](../type-aliases/VirtualOri key-and-timing rules, including truncate and overlapping mutations. For local-only collections, this is always `'local'`. -For live query collections, this is passed through from the source collection. - -*** - -### ~~$synced~~ - -```ts -readonly $synced: boolean; -``` - -Defined in: [packages/db/src/virtual-props.ts:106](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L106) - -Whether this row currently has no pending local optimistic writes. - -- `true`: No pending local optimistic mutation currently affects this row -- `false`: One or more pending local optimistic mutations currently affect this row - -This is local mutation status. It does not prove that a backend has uploaded, -confirmed, or read back the row. If you need backend-confirmed status, keep -your mutation function pending until that backend observation has happened, -or expose adapter-specific status. - -For local-only collections (no sync), this is always `true`. -For live query collections, this is passed through from the source collection. - -#### Deprecated - -Use `!row.$hasPendingWrites` instead. This alias will be -removed in the 1.0 RC. +Whole-row live queries preserve source attribution. Projected row roots +otherwise use the live-query Collection's attribution. diff --git a/docs/reference/powersync-db-collection/classes/PowerSyncTransactor.md b/docs/reference/powersync-db-collection/classes/PowerSyncTransactor.md index 46c0504013..0ecc509271 100644 --- a/docs/reference/powersync-db-collection/classes/PowerSyncTransactor.md +++ b/docs/reference/powersync-db-collection/classes/PowerSyncTransactor.md @@ -111,7 +111,7 @@ Persists a Transaction to the PowerSync SQLite database. protected getMutationCollectionMeta(mutation): PowerSyncCollectionMeta; ``` -Defined in: [PowerSyncTransactor.ts:341](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L341) +Defined in: [PowerSyncTransactor.ts:340](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L340) #### Parameters @@ -134,7 +134,7 @@ protected handleDelete( waitForCompletion): Promise; ``` -Defined in: [PowerSyncTransactor.ts:259](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L259) +Defined in: [PowerSyncTransactor.ts:258](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L258) #### Parameters @@ -165,7 +165,7 @@ protected handleInsert( waitForCompletion): Promise; ``` -Defined in: [PowerSyncTransactor.ts:181](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L181) +Defined in: [PowerSyncTransactor.ts:180](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L180) #### Parameters @@ -197,7 +197,7 @@ protected handleOperationWithCompletion( handler): Promise; ``` -Defined in: [PowerSyncTransactor.ts:302](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L302) +Defined in: [PowerSyncTransactor.ts:301](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L301) Helper function which wraps a persistence operation by: - Fetching the mutation's collection's SQLite table details @@ -237,7 +237,7 @@ protected handleUpdate( waitForCompletion): Promise; ``` -Defined in: [PowerSyncTransactor.ts:217](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L217) +Defined in: [PowerSyncTransactor.ts:216](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L216) #### Parameters @@ -265,7 +265,7 @@ Defined in: [PowerSyncTransactor.ts:217](https://github.com/TanStack/db/blob/mai protected processMutationMetadata(mutation): string | null; ``` -Defined in: [PowerSyncTransactor.ts:360](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L360) +Defined in: [PowerSyncTransactor.ts:359](https://github.com/TanStack/db/blob/main/packages/powersync-db-collection/src/PowerSyncTransactor.ts#L359) Processes collection mutation metadata for persistence to the database. We only support storing string metadata. diff --git a/docs/reference/query-db-collection/functions/queryCollectionOptions.md b/docs/reference/query-db-collection/functions/queryCollectionOptions.md index e5cd3437a1..19504ae462 100644 --- a/docs/reference/query-db-collection/functions/queryCollectionOptions.md +++ b/docs/reference/query-db-collection/functions/queryCollectionOptions.md @@ -9,7 +9,7 @@ title: queryCollectionOptions function queryCollectionOptions(config): CollectionConfig, TKey, T, QueryCollectionUtils, TKey, InferSchemaInput, 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:574](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L574) Creates query collection options for use with a standard Collection. This integrates TanStack Query with TanStack DB for automatic synchronization. @@ -149,7 +149,7 @@ const todosCollection = createCollection( function queryCollectionOptions(config): CollectionConfig> & object; ``` -Defined in: [packages/query-db-collection/src/query.ts:579](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L579) +Defined in: [packages/query-db-collection/src/query.ts:613](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L613) Creates query collection options for use with a standard Collection. This integrates TanStack Query with TanStack DB for automatic synchronization. @@ -289,7 +289,7 @@ const todosCollection = createCollection( function queryCollectionOptions(config): CollectionConfig, TKey, T, QueryCollectionUtils, TKey, InferSchemaInput, TError>> & object; ``` -Defined in: [packages/query-db-collection/src/query.ts:612](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L612) +Defined in: [packages/query-db-collection/src/query.ts:646](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L646) Creates query collection options for use with a standard Collection. This integrates TanStack Query with TanStack DB for automatic synchronization. @@ -421,7 +421,7 @@ const todosCollection = createCollection( function queryCollectionOptions(config): CollectionConfig> & object; ``` -Defined in: [packages/query-db-collection/src/query.ts:646](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L646) +Defined in: [packages/query-db-collection/src/query.ts:680](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L680) Creates query collection options for use with a standard Collection. This integrates TanStack Query with TanStack DB for automatic synchronization. diff --git a/docs/reference/query-db-collection/interfaces/QueryCollectionConfig.md b/docs/reference/query-db-collection/interfaces/QueryCollectionConfig.md index 16d09031e3..b989b1b6bd 100644 --- a/docs/reference/query-db-collection/interfaces/QueryCollectionConfig.md +++ b/docs/reference/query-db-collection/interfaces/QueryCollectionConfig.md @@ -3,13 +3,13 @@ id: QueryCollectionConfig title: QueryCollectionConfig --- -Defined in: [packages/query-db-collection/src/query.ts:117](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L117) +Defined in: [packages/query-db-collection/src/query.ts:131](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L131) Configuration options for creating a Query Collection ## Extends -- `BaseCollectionConfig`\<`T`, `TKey`, `TSchema`, [`QueryCollectionUtils`](QueryCollectionUtils.md)\<`T`, `TKey`, \[`TSchema`\] *extends* \[`never`\] ? `T` : `InferSchemaInput`\<`TSchema`\>, `TError`\>\> +- `Omit`\<`BaseCollectionConfig`\<`T`, `TKey`, `TSchema`, `QueryCollectionHandlerUtils`\<`T`, `TKey`, `TSchema`, `TError`\>\>, `"onInsert"` \| `"onUpdate"` \| `"onDelete"`\> ## Type Parameters @@ -61,7 +61,7 @@ The schema type for validation optional enabled: Enabled; ``` -Defined in: [packages/query-db-collection/src/query.ts:156](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L156) +Defined in: [packages/query-db-collection/src/query.ts:190](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L190) Whether the query should automatically run (default: true) @@ -73,19 +73,28 @@ Whether the query should automatically run (default: true) optional gcTime: number; ``` -Defined in: [packages/query-db-collection/src/query.ts:191](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L191) +Defined in: [packages/query-db-collection/src/query.ts:225](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L225) Time in milliseconds after which the collection will be garbage collected when it has no active subscribers. Defaults to 5 minutes (300000ms). -Sync started without subscribers gets a minimum 50ms grace period. +Sync started without subscribers gets a minimum 50ms handoff grace period +until a subscriber attaches. After the last subscriber leaves, gcTime +applies without that startup minimum. Pending preloads retain the collection until they settle. Preloading ready -data refreshes the retention period. A non-positive or non-finite value +data refreshes the retention period. A persisting transaction that touches +the collection also retains it, and the period starts again when the last +one completes or fails, preserving any remaining startup grace. Pending +manual transactions do not retain it; keep a subscription for draft +visibility until commit or rollback. Rolling +back a manual transaction that stayed pending preserves the existing GC +deadline. Cleanup runs at a host idle opportunity after the delay. +A non-positive or non-finite value disables automatic garbage collection. #### Overrides ```ts -BaseCollectionConfig.gcTime +Omit.gcTime ``` *** @@ -96,7 +105,7 @@ BaseCollectionConfig.gcTime optional initialData: TQueryData | InitialDataFunction; ``` -Defined in: [packages/query-db-collection/src/query.ts:231](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L231) +Defined in: [packages/query-db-collection/src/query.ts:265](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L265) Data used to initialize the TanStack Query cache for an eager collection. The value has the original Query response shape and is projected through @@ -110,7 +119,7 @@ the collection's select option before rows are materialized. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-db-collection/src/query.ts:239](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L239) +Defined in: [packages/query-db-collection/src/query.ts:273](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L273) The timestamp TanStack Query uses to determine initialData freshness. @@ -122,7 +131,7 @@ The timestamp TanStack Query uses to determine initialData freshness. optional meta: Record; ``` -Defined in: [packages/query-db-collection/src/query.ts:268](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L268) +Defined in: [packages/query-db-collection/src/query.ts:302](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L302) Metadata to pass to the query. Available in queryFn via context.meta @@ -154,7 +163,69 @@ meta: { optional networkMode: NetworkMode; ``` -Defined in: [packages/query-db-collection/src/query.ts:219](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L219) +Defined in: [packages/query-db-collection/src/query.ts:253](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L253) + +*** + +### onDelete()? + +```ts +optional onDelete: (params) => Promise; +``` + +Defined in: [packages/query-db-collection/src/query.ts:165](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L165) + +#### Parameters + +##### params + +`DeleteMutationFnParams`\<`T`, `TKey`, `QueryCollectionHandlerUtils`\<`T`, `TKey`, `TSchema`, `TError`\>\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### onInsert()? + +```ts +optional onInsert: (params) => Promise; +``` + +Defined in: [packages/query-db-collection/src/query.ts:151](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L151) + +Mutation handlers must await an explicit refetch or write confirmed data before settling. + +#### Parameters + +##### params + +`InsertMutationFnParams`\<`T`, `TKey`, `QueryCollectionHandlerUtils`\<`T`, `TKey`, `TSchema`, `TError`\>\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### onUpdate()? + +```ts +optional onUpdate: (params) => Promise; +``` + +Defined in: [packages/query-db-collection/src/query.ts:158](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L158) + +#### Parameters + +##### params + +`UpdateMutationFnParams`\<`T`, `TKey`, `QueryCollectionHandlerUtils`\<`T`, `TKey`, `TSchema`, `TError`\>\> + +#### Returns + +`Promise`\<`void`\> *** @@ -164,7 +235,7 @@ Defined in: [packages/query-db-collection/src/query.ts:219](https://github.com/T optional persistedGcTime: number; ``` -Defined in: [packages/query-db-collection/src/query.ts:246](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L246) +Defined in: [packages/query-db-collection/src/query.ts:280](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L280) *** @@ -174,7 +245,7 @@ Defined in: [packages/query-db-collection/src/query.ts:246](https://github.com/T queryClient: QueryClient; ``` -Defined in: [packages/query-db-collection/src/query.ts:152](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L152) +Defined in: [packages/query-db-collection/src/query.ts:186](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L186) The TanStack Query client instance @@ -186,7 +257,7 @@ The TanStack Query client instance queryFn: TQueryFn extends (context) => any[] | Promise ? (context) => T[] | Promise : TQueryFn; ``` -Defined in: [packages/query-db-collection/src/query.ts:141](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L141) +Defined in: [packages/query-db-collection/src/query.ts:175](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L175) Function that fetches data from the server. Must return the complete collection state @@ -198,7 +269,7 @@ Function that fetches data from the server. Must return the complete collection queryKey: TQueryKey | TQueryKeyBuilder; ``` -Defined in: [packages/query-db-collection/src/query.ts:139](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L139) +Defined in: [packages/query-db-collection/src/query.ts:173](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L173) The query key used by TanStack Query to identify this query @@ -210,7 +281,7 @@ The query key used by TanStack Query to identify this query optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-db-collection/src/query.ts:163](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L163) +Defined in: [packages/query-db-collection/src/query.ts:197](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L197) *** @@ -220,7 +291,7 @@ Defined in: [packages/query-db-collection/src/query.ts:163](https://github.com/T optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-db-collection/src/query.ts:212](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L212) +Defined in: [packages/query-db-collection/src/query.ts:246](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L246) *** @@ -230,7 +301,7 @@ Defined in: [packages/query-db-collection/src/query.ts:212](https://github.com/T optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-db-collection/src/query.ts:205](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L205) +Defined in: [packages/query-db-collection/src/query.ts:239](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L239) *** @@ -240,7 +311,7 @@ Defined in: [packages/query-db-collection/src/query.ts:205](https://github.com/T optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-db-collection/src/query.ts:198](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L198) +Defined in: [packages/query-db-collection/src/query.ts:232](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L232) *** @@ -250,7 +321,7 @@ Defined in: [packages/query-db-collection/src/query.ts:198](https://github.com/T optional retry: RetryValue; ``` -Defined in: [packages/query-db-collection/src/query.ts:170](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L170) +Defined in: [packages/query-db-collection/src/query.ts:204](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L204) *** @@ -260,7 +331,7 @@ Defined in: [packages/query-db-collection/src/query.ts:170](https://github.com/T optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-db-collection/src/query.ts:177](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L177) +Defined in: [packages/query-db-collection/src/query.ts:211](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L211) *** @@ -270,7 +341,7 @@ Defined in: [packages/query-db-collection/src/query.ts:177](https://github.com/T optional select: (data) => T[]; ``` -Defined in: [packages/query-db-collection/src/query.ts:150](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L150) +Defined in: [packages/query-db-collection/src/query.ts:184](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L184) Extracts the row array TanStack DB materializes from the Query response. The Query cache keeps the original response shape. @@ -293,4 +364,4 @@ The Query cache keeps the original response shape. optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-db-collection/src/query.ts:184](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L184) +Defined in: [packages/query-db-collection/src/query.ts:218](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L218) diff --git a/docs/reference/query-db-collection/interfaces/QueryCollectionUtils.md b/docs/reference/query-db-collection/interfaces/QueryCollectionUtils.md index dc712307a0..163faa3f2f 100644 --- a/docs/reference/query-db-collection/interfaces/QueryCollectionUtils.md +++ b/docs/reference/query-db-collection/interfaces/QueryCollectionUtils.md @@ -3,7 +3,7 @@ id: QueryCollectionUtils title: QueryCollectionUtils --- -Defined in: [packages/query-db-collection/src/query.ts:301](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L301) +Defined in: [packages/query-db-collection/src/query.ts:335](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L335) Utility methods available on Query Collections for direct writes and manual operations. Direct writes bypass optimistic mutations and write to the synced data store. @@ -46,7 +46,7 @@ The type accepted for insert operations dataUpdatedAt: number; ``` -Defined in: [packages/query-db-collection/src/query.ts:334](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L334) +Defined in: [packages/query-db-collection/src/query.ts:368](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L368) Get timestamp of last successful data update (in milliseconds) @@ -58,7 +58,7 @@ Get timestamp of last successful data update (in milliseconds) fetchStatus: "idle" | "fetching" | "paused"; ``` -Defined in: [packages/query-db-collection/src/query.ts:340](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L340) +Defined in: [packages/query-db-collection/src/query.ts:374](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L374) Get the aggregate observer fetch status. Returns `fetching` if any observer is fetching, otherwise `paused` if any observer is paused, and @@ -72,7 +72,7 @@ observer is fetching, otherwise `paused` if any observer is paused, and isFetching: boolean; ``` -Defined in: [packages/query-db-collection/src/query.ts:328](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L328) +Defined in: [packages/query-db-collection/src/query.ts:362](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L362) Check if query is currently fetching (initial or background) @@ -84,7 +84,7 @@ Check if query is currently fetching (initial or background) isLoading: boolean; ``` -Defined in: [packages/query-db-collection/src/query.ts:332](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L332) +Defined in: [packages/query-db-collection/src/query.ts:366](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L366) Check if query is loading for the first time (no data yet) @@ -96,7 +96,7 @@ Check if query is loading for the first time (no data yet) isRefetching: boolean; ``` -Defined in: [packages/query-db-collection/src/query.ts:330](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L330) +Defined in: [packages/query-db-collection/src/query.ts:364](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L364) Check if query is refetching in background (not initial fetch) @@ -108,7 +108,7 @@ Check if query is refetching in background (not initial fetch) refetch: RefetchFn; ``` -Defined in: [packages/query-db-collection/src/query.ts:311](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L311) +Defined in: [packages/query-db-collection/src/query.ts:345](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L345) Manually refetch and await the applicable fetch or application boundary. @@ -120,7 +120,7 @@ Manually refetch and await the applicable fetch or application boundary. writeBatch: (callback) => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:323](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L323) +Defined in: [packages/query-db-collection/src/query.ts:357](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L357) Execute direct writes as one atomic batch. Resolves when the sync commit applies. @@ -142,7 +142,7 @@ Execute direct writes as one atomic batch. Resolves when the sync commit applies writeDelete: (keys) => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:319](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L319) +Defined in: [packages/query-db-collection/src/query.ts:353](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L353) Delete items without an optimistic update. Resolves when the sync commit applies. @@ -164,7 +164,7 @@ Delete items without an optimistic update. Resolves when the sync commit applies writeInsert: (data) => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:313](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L313) +Defined in: [packages/query-db-collection/src/query.ts:347](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L347) Insert items without an optimistic update. Resolves when the sync commit applies. @@ -186,7 +186,7 @@ Insert items without an optimistic update. Resolves when the sync commit applies writeUpdate: (updates) => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:315](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L315) +Defined in: [packages/query-db-collection/src/query.ts:349](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L349) Update items without an optimistic update. Resolves when the sync commit applies. @@ -208,7 +208,7 @@ Update items without an optimistic update. Resolves when the sync commit applies writeUpsert: (data) => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:321](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L321) +Defined in: [packages/query-db-collection/src/query.ts:355](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L355) Insert or update items without an optimistic update. Resolves when the sync commit applies. diff --git a/docs/reference/rxdb-db-collection/functions/rxdbCollectionOptions.md b/docs/reference/rxdb-db-collection/functions/rxdbCollectionOptions.md index 4b0834eda3..bec830b62c 100644 --- a/docs/reference/rxdb-db-collection/functions/rxdbCollectionOptions.md +++ b/docs/reference/rxdb-db-collection/functions/rxdbCollectionOptions.md @@ -53,7 +53,7 @@ Creates RxDB collection options for use with a standard Collection #### config -`Omit`\<`BaseCollectionConfig`\<`T`, `string`, `never`, `UtilsRecord`, `any`\>, `"getKey"` \| `"onInsert"` \| `"onUpdate"` \| `"onDelete"`\> & `object` & `object` +`Omit`\<`BaseCollectionConfig`\<`T`, `string`, `never`, `UtilsRecord`\>, `"getKey"` \| `"onInsert"` \| `"onUpdate"` \| `"onDelete"`\> & `object` & `object` Configuration options for the RxDB collection diff --git a/docs/reference/type-aliases/ApplyJoinOptionalityToMergedSchema.md b/docs/reference/type-aliases/ApplyJoinOptionalityToMergedSchema.md index dccdbf6237..1a6879955f 100644 --- a/docs/reference/type-aliases/ApplyJoinOptionalityToMergedSchema.md +++ b/docs/reference/type-aliases/ApplyJoinOptionalityToMergedSchema.md @@ -7,7 +7,7 @@ title: ApplyJoinOptionalityToMergedSchema type ApplyJoinOptionalityToMergedSchema = { [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:1075](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1075) +Defined in: [packages/db/src/query/builder/types.ts:1071](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1071) ApplyJoinOptionalityToMergedSchema - Applies optionality rules when merging schemas diff --git a/docs/reference/type-aliases/ChangeListener.md b/docs/reference/type-aliases/ChangeListener.md index cf44dd2735..9f444c87d3 100644 --- a/docs/reference/type-aliases/ChangeListener.md +++ b/docs/reference/type-aliases/ChangeListener.md @@ -7,7 +7,7 @@ title: ChangeListener type ChangeListener = (changes) => void; ``` -Defined in: [packages/db/src/types.ts:1332](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1332) +Defined in: [packages/db/src/types.ts:1367](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1367) Function type for listening to collection changes Changes to the same key retain their causal order within a callback. diff --git a/docs/reference/type-aliases/ChangeMessageOrDeleteKeyMessage.md b/docs/reference/type-aliases/ChangeMessageOrDeleteKeyMessage.md index c05f1b65d4..caf9b3b9ec 100644 --- a/docs/reference/type-aliases/ChangeMessageOrDeleteKeyMessage.md +++ b/docs/reference/type-aliases/ChangeMessageOrDeleteKeyMessage.md @@ -9,7 +9,7 @@ type ChangeMessageOrDeleteKeyMessage = | DeleteKeyMessage; ``` -Defined in: [packages/db/src/types.ts:636](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L636) +Defined in: [packages/db/src/types.ts:676](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L676) ## Type Parameters diff --git a/docs/reference/type-aliases/ChangesPayload.md b/docs/reference/type-aliases/ChangesPayload.md index a4330d5020..a13b1d8349 100644 --- a/docs/reference/type-aliases/ChangesPayload.md +++ b/docs/reference/type-aliases/ChangesPayload.md @@ -7,7 +7,7 @@ title: ChangesPayload type ChangesPayload = ChangeMessage, TKey>[]; ``` -Defined in: [packages/db/src/types.ts:1143](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1143) +Defined in: [packages/db/src/types.ts:1174](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1174) ## Type Parameters diff --git a/docs/reference/type-aliases/CleanupFn.md b/docs/reference/type-aliases/CleanupFn.md index 47d8eeb4d5..896e971029 100644 --- a/docs/reference/type-aliases/CleanupFn.md +++ b/docs/reference/type-aliases/CleanupFn.md @@ -7,7 +7,7 @@ title: CleanupFn type CleanupFn = () => void | () => Promise; ``` -Defined in: [packages/db/src/types.ts:429](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L429) +Defined in: [packages/db/src/types.ts:430](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L430) Ends one sync run and releases its adapter-owned resources. diff --git a/docs/reference/type-aliases/CollectionConfigSingleRowOption.md b/docs/reference/type-aliases/CollectionConfigSingleRowOption.md index 19e780b674..b55210d0a4 100644 --- a/docs/reference/type-aliases/CollectionConfigSingleRowOption.md +++ b/docs/reference/type-aliases/CollectionConfigSingleRowOption.md @@ -7,7 +7,7 @@ title: CollectionConfigSingleRowOption type CollectionConfigSingleRowOption = CollectionConfig & MaybeSingleResult; ``` -Defined in: [packages/db/src/types.ts:1136](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1136) +Defined in: [packages/db/src/types.ts:1167](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1167) ## Type Parameters diff --git a/docs/reference/type-aliases/CollectionMaterializeOptions.md b/docs/reference/type-aliases/CollectionMaterializeOptions.md index 24be78451d..23b9b76ad8 100644 --- a/docs/reference/type-aliases/CollectionMaterializeOptions.md +++ b/docs/reference/type-aliases/CollectionMaterializeOptions.md @@ -7,7 +7,7 @@ title: CollectionMaterializeOptions type CollectionMaterializeOptions = object; ``` -Defined in: [packages/db/src/client.ts:119](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L119) +Defined in: [packages/db/src/client.ts:126](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L126) ## Type Parameters @@ -23,4 +23,4 @@ Defined in: [packages/db/src/client.ts:119](https://github.com/TanStack/db/blob/ optional initialData: T[]; ``` -Defined in: [packages/db/src/client.ts:120](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L120) +Defined in: [packages/db/src/client.ts:127](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L127) diff --git a/docs/reference/type-aliases/CollectionOptions.md b/docs/reference/type-aliases/CollectionOptions.md index db41579f1a..82c71ede89 100644 --- a/docs/reference/type-aliases/CollectionOptions.md +++ b/docs/reference/type-aliases/CollectionOptions.md @@ -7,7 +7,7 @@ title: CollectionOptions type CollectionOptions = CollectionOptionsIdentity; ``` -Defined in: [packages/db/src/client.ts:47](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L47) +Defined in: [packages/db/src/client.ts:54](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L54) ## Type Parameters diff --git a/docs/reference/type-aliases/CollectionStatus.md b/docs/reference/type-aliases/CollectionStatus.md index e6e1ac2a7c..111d7c0c9d 100644 --- a/docs/reference/type-aliases/CollectionStatus.md +++ b/docs/reference/type-aliases/CollectionStatus.md @@ -7,7 +7,7 @@ title: CollectionStatus type CollectionStatus = "idle" | "loading" | "ready" | "error" | "crashed" | "cleaned-up"; ``` -Defined in: [packages/db/src/types.ts:769](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L769) +Defined in: [packages/db/src/types.ts:797](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L797) Collection status values for lifecycle management diff --git a/docs/reference/type-aliases/ContextFromSource.md b/docs/reference/type-aliases/ContextFromSource.md index 538bb54705..416a68e283 100644 --- a/docs/reference/type-aliases/ContextFromSource.md +++ b/docs/reference/type-aliases/ContextFromSource.md @@ -7,7 +7,7 @@ title: ContextFromSource type ContextFromSource = object; ``` -Defined in: [packages/db/src/query/builder/types.ts:155](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L155) +Defined in: [packages/db/src/query/builder/types.ts:152](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L152) ## Type Parameters @@ -23,7 +23,7 @@ Defined in: [packages/db/src/query/builder/types.ts:155](https://github.com/TanS baseSchema: SchemaFromSource; ``` -Defined in: [packages/db/src/query/builder/types.ts:156](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L156) +Defined in: [packages/db/src/query/builder/types.ts:153](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L153) *** @@ -33,7 +33,7 @@ Defined in: [packages/db/src/query/builder/types.ts:156](https://github.com/TanS fromSourceName: keyof TSource & string; ``` -Defined in: [packages/db/src/query/builder/types.ts:158](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L158) +Defined in: [packages/db/src/query/builder/types.ts:155](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L155) *** @@ -43,7 +43,7 @@ Defined in: [packages/db/src/query/builder/types.ts:158](https://github.com/TanS hasJoins: false; ``` -Defined in: [packages/db/src/query/builder/types.ts:159](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L159) +Defined in: [packages/db/src/query/builder/types.ts:156](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L156) *** @@ -53,4 +53,4 @@ Defined in: [packages/db/src/query/builder/types.ts:159](https://github.com/TanS schema: SchemaFromSource; ``` -Defined in: [packages/db/src/query/builder/types.ts:157](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L157) +Defined in: [packages/db/src/query/builder/types.ts:154](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L154) diff --git a/docs/reference/type-aliases/ContextFromUnionBranches.md b/docs/reference/type-aliases/ContextFromUnionBranches.md index 72dd0a7515..5f82e9e756 100644 --- a/docs/reference/type-aliases/ContextFromUnionBranches.md +++ b/docs/reference/type-aliases/ContextFromUnionBranches.md @@ -7,7 +7,7 @@ title: ContextFromUnionBranches type ContextFromUnionBranches = object; ``` -Defined in: [packages/db/src/query/builder/types.ts:189](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L189) +Defined in: [packages/db/src/query/builder/types.ts:186](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L186) ## Type Parameters @@ -23,7 +23,7 @@ Defined in: [packages/db/src/query/builder/types.ts:189](https://github.com/TanS [BranchUnionRefs]: UnionBranchResult; ``` -Defined in: [packages/db/src/query/builder/types.ts:199](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L199) +Defined in: [packages/db/src/query/builder/types.ts:196](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L196) *** @@ -33,7 +33,7 @@ Defined in: [packages/db/src/query/builder/types.ts:199](https://github.com/TanS baseSchema: UnionBranchSchema; ``` -Defined in: [packages/db/src/query/builder/types.ts:192](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L192) +Defined in: [packages/db/src/query/builder/types.ts:189](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L189) *** @@ -43,7 +43,7 @@ Defined in: [packages/db/src/query/builder/types.ts:192](https://github.com/TanS fromSourceName: keyof UnionBranchSchema & string; ``` -Defined in: [packages/db/src/query/builder/types.ts:195](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L195) +Defined in: [packages/db/src/query/builder/types.ts:192](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L192) *** @@ -53,7 +53,7 @@ Defined in: [packages/db/src/query/builder/types.ts:195](https://github.com/TanS hasJoins: false; ``` -Defined in: [packages/db/src/query/builder/types.ts:196](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L196) +Defined in: [packages/db/src/query/builder/types.ts:193](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L193) *** @@ -63,7 +63,7 @@ Defined in: [packages/db/src/query/builder/types.ts:196](https://github.com/TanS hasResult: true; ``` -Defined in: [packages/db/src/query/builder/types.ts:198](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L198) +Defined in: [packages/db/src/query/builder/types.ts:195](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L195) *** @@ -73,7 +73,7 @@ Defined in: [packages/db/src/query/builder/types.ts:198](https://github.com/TanS refsSchema: UnionBranchSchema; ``` -Defined in: [packages/db/src/query/builder/types.ts:194](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L194) +Defined in: [packages/db/src/query/builder/types.ts:191](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L191) *** @@ -83,7 +83,7 @@ Defined in: [packages/db/src/query/builder/types.ts:194](https://github.com/TanS result: PrettifyIfPlainObject>; ``` -Defined in: [packages/db/src/query/builder/types.ts:197](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L197) +Defined in: [packages/db/src/query/builder/types.ts:194](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L194) *** @@ -93,4 +93,4 @@ Defined in: [packages/db/src/query/builder/types.ts:197](https://github.com/TanS schema: UnionBranchSchema; ``` -Defined in: [packages/db/src/query/builder/types.ts:193](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L193) +Defined in: [packages/db/src/query/builder/types.ts:190](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L190) diff --git a/docs/reference/type-aliases/ContextFromUnionSource.md b/docs/reference/type-aliases/ContextFromUnionSource.md index 50b1cd223f..da7fbdc3e6 100644 --- a/docs/reference/type-aliases/ContextFromUnionSource.md +++ b/docs/reference/type-aliases/ContextFromUnionSource.md @@ -7,7 +7,7 @@ title: ContextFromUnionSource type ContextFromUnionSource = IsUnion extends true ? object : ContextFromSource; ``` -Defined in: [packages/db/src/query/builder/types.ts:162](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L162) +Defined in: [packages/db/src/query/builder/types.ts:159](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L159) ## Type Parameters diff --git a/docs/reference/type-aliases/ContextSchema.md b/docs/reference/type-aliases/ContextSchema.md index b71ea52f8c..20fc9949d4 100644 --- a/docs/reference/type-aliases/ContextSchema.md +++ b/docs/reference/type-aliases/ContextSchema.md @@ -7,7 +7,7 @@ title: ContextSchema type ContextSchema = Record; ``` -Defined in: [packages/db/src/query/builder/types.ts:85](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L85) +Defined in: [packages/db/src/query/builder/types.ts:82](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L82) ContextSchema - The shape of available tables/collections in a query context diff --git a/docs/reference/type-aliases/DbClientEvent.md b/docs/reference/type-aliases/DbClientEvent.md index 0294272feb..685fa90f40 100644 --- a/docs/reference/type-aliases/DbClientEvent.md +++ b/docs/reference/type-aliases/DbClientEvent.md @@ -15,4 +15,4 @@ type DbClientEvent = }; ``` -Defined in: [packages/db/src/client.ts:177](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L177) +Defined in: [packages/db/src/client.ts:184](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L184) diff --git a/docs/reference/type-aliases/DbClientLiveQuery.md b/docs/reference/type-aliases/DbClientLiveQuery.md index 4793cf8ba6..15aa2f1892 100644 --- a/docs/reference/type-aliases/DbClientLiveQuery.md +++ b/docs/reference/type-aliases/DbClientLiveQuery.md @@ -7,7 +7,7 @@ title: DbClientLiveQuery type DbClientLiveQuery = object; ``` -Defined in: [packages/db/src/client.ts:166](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L166) +Defined in: [packages/db/src/client.ts:173](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L173) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/db/src/client.ts:166](https://github.com/TanStack/db/blob/ readonly dehydratedAt: number; ``` -Defined in: [packages/db/src/client.ts:168](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L168) +Defined in: [packages/db/src/client.ts:175](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L175) *** @@ -27,7 +27,7 @@ Defined in: [packages/db/src/client.ts:168](https://github.com/TanStack/db/blob/ readonly optional error: unknown; ``` -Defined in: [packages/db/src/client.ts:174](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L174) +Defined in: [packages/db/src/client.ts:181](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L181) *** @@ -37,7 +37,7 @@ Defined in: [packages/db/src/client.ts:174](https://github.com/TanStack/db/blob/ readonly optional initialSnapshot: DehydratedLiveQueryResult; ``` -Defined in: [packages/db/src/client.ts:172](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L172) +Defined in: [packages/db/src/client.ts:179](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L179) Initial hydration view retained while a local preload completes. @@ -49,7 +49,7 @@ Initial hydration view retained while a local preload completes. readonly promise: Promise; ``` -Defined in: [packages/db/src/client.ts:170](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L170) +Defined in: [packages/db/src/client.ts:177](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L177) *** @@ -59,7 +59,7 @@ Defined in: [packages/db/src/client.ts:170](https://github.com/TanStack/db/blob/ readonly queryHash: string; ``` -Defined in: [packages/db/src/client.ts:167](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L167) +Defined in: [packages/db/src/client.ts:174](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L174) *** @@ -69,7 +69,7 @@ Defined in: [packages/db/src/client.ts:167](https://github.com/TanStack/db/blob/ readonly optional snapshot: DehydratedLiveQueryResult; ``` -Defined in: [packages/db/src/client.ts:173](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L173) +Defined in: [packages/db/src/client.ts:180](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L180) *** @@ -79,4 +79,4 @@ Defined in: [packages/db/src/client.ts:173](https://github.com/TanStack/db/blob/ readonly status: DbClientLiveQueryState; ``` -Defined in: [packages/db/src/client.ts:169](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L169) +Defined in: [packages/db/src/client.ts:176](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L176) diff --git a/docs/reference/type-aliases/DbClientLiveQueryState.md b/docs/reference/type-aliases/DbClientLiveQueryState.md index ad4d8b4903..b7b7d22e01 100644 --- a/docs/reference/type-aliases/DbClientLiveQueryState.md +++ b/docs/reference/type-aliases/DbClientLiveQueryState.md @@ -7,4 +7,4 @@ title: DbClientLiveQueryState type DbClientLiveQueryState = "pending" | "success" | "error"; ``` -Defined in: [packages/db/src/client.ts:164](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L164) +Defined in: [packages/db/src/client.ts:171](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L171) diff --git a/docs/reference/type-aliases/DbClientOptions.md b/docs/reference/type-aliases/DbClientOptions.md index 5a68cbd814..132ee346b1 100644 --- a/docs/reference/type-aliases/DbClientOptions.md +++ b/docs/reference/type-aliases/DbClientOptions.md @@ -7,4 +7,4 @@ title: DbClientOptions type DbClientOptions = Record; ``` -Defined in: [packages/db/src/client.ts:212](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L212) +Defined in: [packages/db/src/client.ts:220](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L220) diff --git a/docs/reference/type-aliases/DeferredLiveQueryCollections.md b/docs/reference/type-aliases/DeferredLiveQueryCollections.md index b62ec4be90..29d04ef4f6 100644 --- a/docs/reference/type-aliases/DeferredLiveQueryCollections.md +++ b/docs/reference/type-aliases/DeferredLiveQueryCollections.md @@ -7,4 +7,4 @@ title: DeferredLiveQueryCollections type DeferredLiveQueryCollections = Set>; ``` -Defined in: [packages/db/src/live-query-options.ts:52](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L52) +Defined in: [packages/db/src/live-query-options.ts:53](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L53) diff --git a/docs/reference/type-aliases/DehydrateDbClientOptions.md b/docs/reference/type-aliases/DehydrateDbClientOptions.md index 093a63c7b0..9358f7ded0 100644 --- a/docs/reference/type-aliases/DehydrateDbClientOptions.md +++ b/docs/reference/type-aliases/DehydrateDbClientOptions.md @@ -7,7 +7,7 @@ title: DehydrateDbClientOptions type DehydrateDbClientOptions = object; ``` -Defined in: [packages/db/src/client.ts:187](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L187) +Defined in: [packages/db/src/client.ts:194](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L194) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/db/src/client.ts:187](https://github.com/TanStack/db/blob/ optional shouldDehydrateCollection: (collection) => boolean; ``` -Defined in: [packages/db/src/client.ts:188](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L188) +Defined in: [packages/db/src/client.ts:195](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L195) #### Parameters @@ -37,7 +37,7 @@ Defined in: [packages/db/src/client.ts:188](https://github.com/TanStack/db/blob/ optional shouldDehydrateLiveQuery: (query) => boolean; ``` -Defined in: [packages/db/src/client.ts:189](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L189) +Defined in: [packages/db/src/client.ts:196](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L196) #### Parameters diff --git a/docs/reference/type-aliases/DehydratedCollectionChunk.md b/docs/reference/type-aliases/DehydratedCollectionChunk.md index ab410172b2..cc9ac0ff73 100644 --- a/docs/reference/type-aliases/DehydratedCollectionChunk.md +++ b/docs/reference/type-aliases/DehydratedCollectionChunk.md @@ -7,7 +7,7 @@ title: DehydratedCollectionChunk type DehydratedCollectionChunk = object; ``` -Defined in: [packages/db/src/client.ts:132](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L132) +Defined in: [packages/db/src/client.ts:139](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L139) ## Type Parameters @@ -27,7 +27,7 @@ Defined in: [packages/db/src/client.ts:132](https://github.com/TanStack/db/blob/ collectionId: string; ``` -Defined in: [packages/db/src/client.ts:136](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L136) +Defined in: [packages/db/src/client.ts:143](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L143) *** @@ -37,7 +37,7 @@ Defined in: [packages/db/src/client.ts:136](https://github.com/TanStack/db/blob/ rows: DehydratedCollectionRow[]; ``` -Defined in: [packages/db/src/client.ts:137](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L137) +Defined in: [packages/db/src/client.ts:144](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L144) *** @@ -47,4 +47,4 @@ Defined in: [packages/db/src/client.ts:137](https://github.com/TanStack/db/blob/ optional syncMeta: unknown; ``` -Defined in: [packages/db/src/client.ts:138](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L138) +Defined in: [packages/db/src/client.ts:145](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L145) diff --git a/docs/reference/type-aliases/DehydratedCollectionRow.md b/docs/reference/type-aliases/DehydratedCollectionRow.md index d3a812ab69..3249b69caf 100644 --- a/docs/reference/type-aliases/DehydratedCollectionRow.md +++ b/docs/reference/type-aliases/DehydratedCollectionRow.md @@ -7,7 +7,7 @@ title: DehydratedCollectionRow type DehydratedCollectionRow = object; ``` -Defined in: [packages/db/src/client.ts:123](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L123) +Defined in: [packages/db/src/client.ts:130](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L130) ## Type Parameters @@ -27,7 +27,7 @@ Defined in: [packages/db/src/client.ts:123](https://github.com/TanStack/db/blob/ key: TKey; ``` -Defined in: [packages/db/src/client.ts:127](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L127) +Defined in: [packages/db/src/client.ts:134](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L134) *** @@ -37,7 +37,7 @@ Defined in: [packages/db/src/client.ts:127](https://github.com/TanStack/db/blob/ optional metadata: unknown; ``` -Defined in: [packages/db/src/client.ts:129](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L129) +Defined in: [packages/db/src/client.ts:136](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L136) *** @@ -47,4 +47,4 @@ Defined in: [packages/db/src/client.ts:129](https://github.com/TanStack/db/blob/ value: T; ``` -Defined in: [packages/db/src/client.ts:128](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L128) +Defined in: [packages/db/src/client.ts:135](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L135) diff --git a/docs/reference/type-aliases/DehydratedDbState.md b/docs/reference/type-aliases/DehydratedDbState.md index 14baa5b792..7971cf7d32 100644 --- a/docs/reference/type-aliases/DehydratedDbState.md +++ b/docs/reference/type-aliases/DehydratedDbState.md @@ -7,7 +7,7 @@ title: DehydratedDbState type DehydratedDbState = object; ``` -Defined in: [packages/db/src/client.ts:159](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L159) +Defined in: [packages/db/src/client.ts:166](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L166) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/db/src/client.ts:159](https://github.com/TanStack/db/blob/ collections: DehydratedCollectionChunk[]; ``` -Defined in: [packages/db/src/client.ts:160](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L160) +Defined in: [packages/db/src/client.ts:167](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L167) *** @@ -27,4 +27,4 @@ Defined in: [packages/db/src/client.ts:160](https://github.com/TanStack/db/blob/ optional liveQueries: DehydratedLiveQuery[]; ``` -Defined in: [packages/db/src/client.ts:161](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L161) +Defined in: [packages/db/src/client.ts:168](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L168) diff --git a/docs/reference/type-aliases/DehydratedLiveQuery.md b/docs/reference/type-aliases/DehydratedLiveQuery.md index 556b62dc24..fc4a0b42c6 100644 --- a/docs/reference/type-aliases/DehydratedLiveQuery.md +++ b/docs/reference/type-aliases/DehydratedLiveQuery.md @@ -7,7 +7,7 @@ title: DehydratedLiveQuery type DehydratedLiveQuery = object; ``` -Defined in: [packages/db/src/client.ts:141](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L141) +Defined in: [packages/db/src/client.ts:148](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L148) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/db/src/client.ts:141](https://github.com/TanStack/db/blob/ dehydratedAt: number; ``` -Defined in: [packages/db/src/client.ts:143](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L143) +Defined in: [packages/db/src/client.ts:150](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L150) *** @@ -27,7 +27,7 @@ Defined in: [packages/db/src/client.ts:143](https://github.com/TanStack/db/blob/ optional initialSnapshot: DehydratedLiveQueryResult; ``` -Defined in: [packages/db/src/client.ts:145](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L145) +Defined in: [packages/db/src/client.ts:152](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L152) Earlier ordinary markup may precede a shared Suspense result. @@ -39,7 +39,7 @@ Earlier ordinary markup may precede a shared Suspense result. optional promise: Promise; ``` -Defined in: [packages/db/src/client.ts:147](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L147) +Defined in: [packages/db/src/client.ts:154](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L154) *** @@ -49,7 +49,7 @@ Defined in: [packages/db/src/client.ts:147](https://github.com/TanStack/db/blob/ queryHash: string; ``` -Defined in: [packages/db/src/client.ts:142](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L142) +Defined in: [packages/db/src/client.ts:149](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L149) *** @@ -59,4 +59,4 @@ Defined in: [packages/db/src/client.ts:142](https://github.com/TanStack/db/blob/ optional snapshot: DehydratedLiveQueryResult; ``` -Defined in: [packages/db/src/client.ts:146](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L146) +Defined in: [packages/db/src/client.ts:153](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L153) diff --git a/docs/reference/type-aliases/DehydratedLiveQueryResult.md b/docs/reference/type-aliases/DehydratedLiveQueryResult.md index 0b1c86f6d0..ce95b2b8c2 100644 --- a/docs/reference/type-aliases/DehydratedLiveQueryResult.md +++ b/docs/reference/type-aliases/DehydratedLiveQueryResult.md @@ -7,7 +7,7 @@ title: DehydratedLiveQueryResult type DehydratedLiveQueryResult = object; ``` -Defined in: [packages/db/src/client.ts:150](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L150) +Defined in: [packages/db/src/client.ts:157](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L157) ## Type Parameters @@ -27,7 +27,7 @@ Defined in: [packages/db/src/client.ts:150](https://github.com/TanStack/db/blob/ rows: DehydratedCollectionRow[]; ``` -Defined in: [packages/db/src/client.ts:154](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L154) +Defined in: [packages/db/src/client.ts:161](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L161) *** @@ -37,6 +37,6 @@ Defined in: [packages/db/src/client.ts:154](https://github.com/TanStack/db/blob/ optional status: "loading" | "error"; ``` -Defined in: [packages/db/src/client.ts:156](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L156) +Defined in: [packages/db/src/client.ts:163](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L163) An initial SSR view may precede query readiness. Omitted means ready. diff --git a/docs/reference/type-aliases/DeleteKeyMessage.md b/docs/reference/type-aliases/DeleteKeyMessage.md index 270e130772..38ea5d4cd7 100644 --- a/docs/reference/type-aliases/DeleteKeyMessage.md +++ b/docs/reference/type-aliases/DeleteKeyMessage.md @@ -7,7 +7,7 @@ title: DeleteKeyMessage type DeleteKeyMessage = Omit, "value" | "previousValue" | "type"> & object; ``` -Defined in: [packages/db/src/types.ts:631](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L631) +Defined in: [packages/db/src/types.ts:671](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L671) ## Type Declaration diff --git a/docs/reference/type-aliases/DeleteMutationFn.md b/docs/reference/type-aliases/DeleteMutationFn.md index ac67a70926..b397d75dfc 100644 --- a/docs/reference/type-aliases/DeleteMutationFn.md +++ b/docs/reference/type-aliases/DeleteMutationFn.md @@ -4,10 +4,10 @@ title: DeleteMutationFn --- ```ts -type DeleteMutationFn = (params) => Promise; +type DeleteMutationFn = (params) => Promise; ``` -Defined in: [packages/db/src/types.ts:745](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L745) +Defined in: [packages/db/src/types.ts:774](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L774) ## Type Parameters @@ -23,12 +23,6 @@ Defined in: [packages/db/src/types.ts:745](https://github.com/TanStack/db/blob/m `TUtils` *extends* [`UtilsRecord`](UtilsRecord.md) = [`UtilsRecord`](UtilsRecord.md) -### TReturn - -`TReturn` = `any` - -DEPRECATED: Return values are kept for backward compatibility and will be removed in v1.0. - ## Parameters ### params @@ -37,4 +31,4 @@ DEPRECATED: Return values are kept for backward compatibility and will be remove ## Returns -`Promise`\<`TReturn`\> +`Promise`\<`void`\> diff --git a/docs/reference/type-aliases/DeleteMutationFnParams.md b/docs/reference/type-aliases/DeleteMutationFnParams.md index 85649ecc8f..d172a7ace2 100644 --- a/docs/reference/type-aliases/DeleteMutationFnParams.md +++ b/docs/reference/type-aliases/DeleteMutationFnParams.md @@ -7,7 +7,7 @@ title: DeleteMutationFnParams type DeleteMutationFnParams = object; ``` -Defined in: [packages/db/src/types.ts:709](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L709) +Defined in: [packages/db/src/types.ts:749](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L749) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/db/src/types.ts:709](https://github.com/TanStack/db/blob/m collection: Collection; ``` -Defined in: [packages/db/src/types.ts:719](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L719) +Defined in: [packages/db/src/types.ts:759](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L759) *** @@ -41,4 +41,4 @@ Defined in: [packages/db/src/types.ts:719](https://github.com/TanStack/db/blob/m transaction: TransactionWithMutations>; ``` -Defined in: [packages/db/src/types.ts:714](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L714) +Defined in: [packages/db/src/types.ts:754](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L754) diff --git a/docs/reference/type-aliases/DeltaEvent.md b/docs/reference/type-aliases/DeltaEvent.md index 726b4e3ab7..236cf7091c 100644 --- a/docs/reference/type-aliases/DeltaEvent.md +++ b/docs/reference/type-aliases/DeltaEvent.md @@ -26,7 +26,7 @@ type DeltaEvent = }; ``` -Defined in: [packages/db/src/query/effect.ts:58](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L58) +Defined in: [packages/db/src/query/effect.ts:59](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L59) Delta event emitted when a row enters, exits, or updates within a query result diff --git a/docs/reference/type-aliases/DeltaType.md b/docs/reference/type-aliases/DeltaType.md index 8e7cf85e4b..82f65bcf5e 100644 --- a/docs/reference/type-aliases/DeltaType.md +++ b/docs/reference/type-aliases/DeltaType.md @@ -7,6 +7,6 @@ title: DeltaType type DeltaType = "enter" | "exit" | "update"; ``` -Defined in: [packages/db/src/query/effect.ts:55](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L55) +Defined in: [packages/db/src/query/effect.ts:56](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L56) Event types for query result deltas diff --git a/docs/reference/type-aliases/EffectQueryInput.md b/docs/reference/type-aliases/EffectQueryInput.md index f3107b0d53..25168dd0eb 100644 --- a/docs/reference/type-aliases/EffectQueryInput.md +++ b/docs/reference/type-aliases/EffectQueryInput.md @@ -9,7 +9,7 @@ type EffectQueryInput = | QueryBuilder; ``` -Defined in: [packages/db/src/query/effect.ts:95](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L95) +Defined in: [packages/db/src/query/effect.ts:96](https://github.com/TanStack/db/blob/main/packages/db/src/query/effect.ts#L96) Query input - can be a builder function or a prebuilt query diff --git a/docs/reference/type-aliases/FunctionalHavingRow.md b/docs/reference/type-aliases/FunctionalHavingRow.md index 9fd73458a5..3837b4ab06 100644 --- a/docs/reference/type-aliases/FunctionalHavingRow.md +++ b/docs/reference/type-aliases/FunctionalHavingRow.md @@ -7,7 +7,7 @@ title: FunctionalHavingRow type FunctionalHavingRow = TContext["schema"] & TContext["hasResult"] extends true ? object : object; ``` -Defined in: [packages/db/src/query/builder/types.ts:700](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L700) +Defined in: [packages/db/src/query/builder/types.ts:697](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L697) FunctionalHavingRow - Type for the row parameter in functional having callbacks diff --git a/docs/reference/type-aliases/GetResult.md b/docs/reference/type-aliases/GetResult.md index 14e0751144..0722d5144f 100644 --- a/docs/reference/type-aliases/GetResult.md +++ b/docs/reference/type-aliases/GetResult.md @@ -7,7 +7,7 @@ title: GetResult type GetResult = Prettify>; ``` -Defined in: [packages/db/src/query/builder/types.ts:1209](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1209) +Defined in: [packages/db/src/query/builder/types.ts:1216](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1216) ## Type Parameters diff --git a/docs/reference/type-aliases/GroupByCallback.md b/docs/reference/type-aliases/GroupByCallback.md index 856824c727..c7e20e70fb 100644 --- a/docs/reference/type-aliases/GroupByCallback.md +++ b/docs/reference/type-aliases/GroupByCallback.md @@ -7,7 +7,7 @@ title: GroupByCallback type GroupByCallback = (refs) => any; ``` -Defined in: [packages/db/src/query/builder/types.ts:652](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L652) +Defined in: [packages/db/src/query/builder/types.ts:649](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L649) GroupByCallback - Type for groupBy clause callback functions diff --git a/docs/reference/type-aliases/InferCollectionType.md b/docs/reference/type-aliases/InferCollectionType.md index 4a835008bd..7f10b06148 100644 --- a/docs/reference/type-aliases/InferCollectionType.md +++ b/docs/reference/type-aliases/InferCollectionType.md @@ -7,7 +7,7 @@ title: InferCollectionType type InferCollectionType = T extends CollectionImpl ? WithVirtualProps : T extends CollectionOptionsIdentity ? WithVirtualProps : never; ``` -Defined in: [packages/db/src/query/builder/types.ts:109](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L109) +Defined in: [packages/db/src/query/builder/types.ts:106](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L106) InferCollectionType - Extracts the TypeScript type from a CollectionImpl diff --git a/docs/reference/type-aliases/InferResultType.md b/docs/reference/type-aliases/InferResultType.md index 0da3a0028d..118f099b23 100644 --- a/docs/reference/type-aliases/InferResultType.md +++ b/docs/reference/type-aliases/InferResultType.md @@ -7,7 +7,7 @@ title: InferResultType type InferResultType = TContext extends SingleResult ? GetResult | undefined : GetResult[]; ``` -Defined in: [packages/db/src/query/builder/types.ts:1101](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1101) +Defined in: [packages/db/src/query/builder/types.ts:1097](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1097) Utility type to infer the query result size (single row or an array) diff --git a/docs/reference/type-aliases/InputRow.md b/docs/reference/type-aliases/InputRow.md index 0de91149e8..3a132504d4 100644 --- a/docs/reference/type-aliases/InputRow.md +++ b/docs/reference/type-aliases/InputRow.md @@ -7,6 +7,6 @@ title: InputRow type InputRow = [unknown, Record]; ``` -Defined in: [packages/db/src/types.ts:1151](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1151) +Defined in: [packages/db/src/types.ts:1182](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1182) An input row from a collection diff --git a/docs/reference/type-aliases/InsertMutationFn.md b/docs/reference/type-aliases/InsertMutationFn.md index 8018590a26..adf9492736 100644 --- a/docs/reference/type-aliases/InsertMutationFn.md +++ b/docs/reference/type-aliases/InsertMutationFn.md @@ -4,10 +4,10 @@ title: InsertMutationFn --- ```ts -type InsertMutationFn = (params) => Promise; +type InsertMutationFn = (params) => Promise; ``` -Defined in: [packages/db/src/types.ts:725](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L725) +Defined in: [packages/db/src/types.ts:762](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L762) ## Type Parameters @@ -23,12 +23,6 @@ Defined in: [packages/db/src/types.ts:725](https://github.com/TanStack/db/blob/m `TUtils` *extends* [`UtilsRecord`](UtilsRecord.md) = [`UtilsRecord`](UtilsRecord.md) -### TReturn - -`TReturn` = `any` - -DEPRECATED: Return values are kept for backward compatibility and will be removed in v1.0. - ## Parameters ### params @@ -37,4 +31,4 @@ DEPRECATED: Return values are kept for backward compatibility and will be remove ## Returns -`Promise`\<`TReturn`\> +`Promise`\<`void`\> diff --git a/docs/reference/type-aliases/InsertMutationFnParams.md b/docs/reference/type-aliases/InsertMutationFnParams.md index d5f0fd851c..c49dc218cd 100644 --- a/docs/reference/type-aliases/InsertMutationFnParams.md +++ b/docs/reference/type-aliases/InsertMutationFnParams.md @@ -7,7 +7,7 @@ title: InsertMutationFnParams type InsertMutationFnParams = object; ``` -Defined in: [packages/db/src/types.ts:697](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L697) +Defined in: [packages/db/src/types.ts:737](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L737) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/db/src/types.ts:697](https://github.com/TanStack/db/blob/m collection: Collection; ``` -Defined in: [packages/db/src/types.ts:707](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L707) +Defined in: [packages/db/src/types.ts:747](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L747) *** @@ -41,4 +41,4 @@ Defined in: [packages/db/src/types.ts:707](https://github.com/TanStack/db/blob/m transaction: TransactionWithMutations>; ``` -Defined in: [packages/db/src/types.ts:702](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L702) +Defined in: [packages/db/src/types.ts:742](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L742) diff --git a/docs/reference/type-aliases/JoinOnCallback.md b/docs/reference/type-aliases/JoinOnCallback.md index 63bc4e963b..480b4a91a5 100644 --- a/docs/reference/type-aliases/JoinOnCallback.md +++ b/docs/reference/type-aliases/JoinOnCallback.md @@ -7,7 +7,7 @@ title: JoinOnCallback type JoinOnCallback = (refs) => any; ``` -Defined in: [packages/db/src/query/builder/types.ts:679](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L679) +Defined in: [packages/db/src/query/builder/types.ts:676](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L676) JoinOnCallback - Type for join condition callback functions diff --git a/docs/reference/type-aliases/KeyedNamespacedRow.md b/docs/reference/type-aliases/KeyedNamespacedRow.md index 4e7cb8b6fb..4b21b71132 100644 --- a/docs/reference/type-aliases/KeyedNamespacedRow.md +++ b/docs/reference/type-aliases/KeyedNamespacedRow.md @@ -7,7 +7,7 @@ title: KeyedNamespacedRow type KeyedNamespacedRow = [unknown, NamespacedRow]; ``` -Defined in: [packages/db/src/types.ts:1174](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1174) +Defined in: [packages/db/src/types.ts:1205](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1205) A keyed namespaced row is a row with a key and a namespaced row This is the main representation of a row in a query pipeline diff --git a/docs/reference/type-aliases/KeyedStream.md b/docs/reference/type-aliases/KeyedStream.md index a14fb02968..02b4a14596 100644 --- a/docs/reference/type-aliases/KeyedStream.md +++ b/docs/reference/type-aliases/KeyedStream.md @@ -7,7 +7,7 @@ title: KeyedStream type KeyedStream = IStreamBuilder; ``` -Defined in: [packages/db/src/types.ts:1157](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1157) +Defined in: [packages/db/src/types.ts:1188](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1188) A keyed stream is a stream of rows This is used as the inputs from a collection to a query diff --git a/docs/reference/type-aliases/LiveQueryCollectionUtils.md b/docs/reference/type-aliases/LiveQueryCollectionUtils.md index 1f7526bc71..e27a9b117a 100644 --- a/docs/reference/type-aliases/LiveQueryCollectionUtils.md +++ b/docs/reference/type-aliases/LiveQueryCollectionUtils.md @@ -7,7 +7,7 @@ title: LiveQueryCollectionUtils type LiveQueryCollectionUtils = UtilsRecord & object; ``` -Defined in: [packages/db/src/query/live/collection-config-builder.ts:64](https://github.com/TanStack/db/blob/main/packages/db/src/query/live/collection-config-builder.ts#L64) +Defined in: [packages/db/src/query/live/collection-config-builder.ts:65](https://github.com/TanStack/db/blob/main/packages/db/src/query/live/collection-config-builder.ts#L65) ## Type Declaration diff --git a/docs/reference/type-aliases/LiveQueryKey.md b/docs/reference/type-aliases/LiveQueryKey.md index 93ae9b8092..ccefa86958 100644 --- a/docs/reference/type-aliases/LiveQueryKey.md +++ b/docs/reference/type-aliases/LiveQueryKey.md @@ -7,4 +7,4 @@ title: LiveQueryKey type LiveQueryKey = ReadonlyArray; ``` -Defined in: [packages/db/src/live-query-options.ts:46](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L46) +Defined in: [packages/db/src/live-query-options.ts:47](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L47) diff --git a/docs/reference/type-aliases/LiveQueryObserverListener.md b/docs/reference/type-aliases/LiveQueryObserverListener.md index 8bb4c8f3a5..dac2ba9ff4 100644 --- a/docs/reference/type-aliases/LiveQueryObserverListener.md +++ b/docs/reference/type-aliases/LiveQueryObserverListener.md @@ -7,7 +7,7 @@ title: LiveQueryObserverListener type LiveQueryObserverListener = (changes) => void; ``` -Defined in: [packages/db/src/live-query-observer.ts:74](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L74) +Defined in: [packages/db/src/live-query-observer.ts:71](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-observer.ts#L71) Listener payload: changes, `[]` for an internal layout-only publication, or `undefined` for a synthetic status/ready notification. diff --git a/docs/reference/type-aliases/LiveQueryOptions.md b/docs/reference/type-aliases/LiveQueryOptions.md index 8d7b74ceb0..1cb8e95a42 100644 --- a/docs/reference/type-aliases/LiveQueryOptions.md +++ b/docs/reference/type-aliases/LiveQueryOptions.md @@ -7,7 +7,7 @@ title: LiveQueryOptions type LiveQueryOptions = LiveQueryCollectionConfig & object; ``` -Defined in: [packages/db/src/live-query-options.ts:48](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L48) +Defined in: [packages/db/src/live-query-options.ts:49](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-options.ts#L49) ## Type Declaration diff --git a/docs/reference/type-aliases/LiveQueryWindowRecompile.md b/docs/reference/type-aliases/LiveQueryWindowRecompile.md index 22f32f475b..dfc8fb9218 100644 --- a/docs/reference/type-aliases/LiveQueryWindowRecompile.md +++ b/docs/reference/type-aliases/LiveQueryWindowRecompile.md @@ -4,16 +4,14 @@ title: LiveQueryWindowRecompile --- ```ts -type LiveQueryWindowRecompile = "identity" | "dependencies" | "always"; +type LiveQueryWindowRecompile = "identity" | "always"; ``` -Defined in: [packages/db/src/live-query-window-binding.ts:74](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L74) +Defined in: [packages/db/src/live-query-window-binding.ts:73](https://github.com/TanStack/db/blob/main/packages/db/src/live-query-window-binding.ts#L73) When a query input compiles again. - `identity`: when its identity dependencies change by structure, as for a derived query identity or a `queryKey`. -- `dependencies`: when a dependency changes by reference, as for a - dependency list. - `always`: on every update, as for a reactive rerun, which happens only when something the query reads changed. diff --git a/docs/reference/type-aliases/LoadSubsetFn.md b/docs/reference/type-aliases/LoadSubsetFn.md index 3e0e740b17..fe2c6530b3 100644 --- a/docs/reference/type-aliases/LoadSubsetFn.md +++ b/docs/reference/type-aliases/LoadSubsetFn.md @@ -7,11 +7,12 @@ title: LoadSubsetFn type LoadSubsetFn = (options) => true | Promise; ``` -Defined in: [packages/db/src/types.ts:399](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L399) +Defined in: [packages/db/src/types.ts:400](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L400) -Loads one subset and transfers its ongoing resource ownership only after -returning `true` or a promise. An implementation that throws synchronously -must release any partially acquired resource before throwing. A successful +Loads one subset. A Collection subscription installs its logical owner +before calling this function. A synchronous throw fails the load but keeps +that owner; releasing the owner still calls `unloadSubset`, if provided, +for the failed load. Make that handler safe after partial setup. A successful implementation must await or return every receipt from the sync `commit()` calls that establish the loaded subset. A result describes only the exact `options` passed to this call. diff --git a/docs/reference/type-aliases/MakeOptional.md b/docs/reference/type-aliases/MakeOptional.md index ae080587c3..ce1496d4df 100644 --- a/docs/reference/type-aliases/MakeOptional.md +++ b/docs/reference/type-aliases/MakeOptional.md @@ -7,7 +7,7 @@ title: MakeOptional type MakeOptional = Omit & Partial>; ``` -Defined in: [packages/db/src/types.ts:1411](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1411) +Defined in: [packages/db/src/types.ts:1446](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1446) ## Type Parameters diff --git a/docs/reference/type-aliases/MaybeSingleResult.md b/docs/reference/type-aliases/MaybeSingleResult.md index 2c69e85dc1..342856936e 100644 --- a/docs/reference/type-aliases/MaybeSingleResult.md +++ b/docs/reference/type-aliases/MaybeSingleResult.md @@ -7,7 +7,7 @@ title: MaybeSingleResult type MaybeSingleResult = object; ``` -Defined in: [packages/db/src/types.ts:1128](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1128) +Defined in: [packages/db/src/types.ts:1159](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1159) ## Properties @@ -17,6 +17,6 @@ Defined in: [packages/db/src/types.ts:1128](https://github.com/TanStack/db/blob/ optional singleResult: true; ``` -Defined in: [packages/db/src/types.ts:1132](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1132) +Defined in: [packages/db/src/types.ts:1163](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1163) If enabled the collection will return a single object instead of an array diff --git a/docs/reference/type-aliases/MergeContextForJoinCallback.md b/docs/reference/type-aliases/MergeContextForJoinCallback.md index 0804a5cc76..d03f712995 100644 --- a/docs/reference/type-aliases/MergeContextForJoinCallback.md +++ b/docs/reference/type-aliases/MergeContextForJoinCallback.md @@ -7,7 +7,7 @@ title: MergeContextForJoinCallback type MergeContextForJoinCallback = Omit & object; ``` -Defined in: [packages/db/src/query/builder/types.ts:1366](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1366) +Defined in: [packages/db/src/query/builder/types.ts:1373](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1373) MergeContextForJoinCallback - Special context for join condition callbacks diff --git a/docs/reference/type-aliases/MergeContextWithJoinType.md b/docs/reference/type-aliases/MergeContextWithJoinType.md index 3b10361c7b..0e384cbe6e 100644 --- a/docs/reference/type-aliases/MergeContextWithJoinType.md +++ b/docs/reference/type-aliases/MergeContextWithJoinType.md @@ -7,7 +7,7 @@ title: MergeContextWithJoinType type MergeContextWithJoinType = Omit & object; ``` -Defined in: [packages/db/src/query/builder/types.ts:1021](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1021) +Defined in: [packages/db/src/query/builder/types.ts:1017](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1017) MergeContextWithJoinType - Creates a new context after a join operation diff --git a/docs/reference/type-aliases/NamespacedAndKeyedStream.md b/docs/reference/type-aliases/NamespacedAndKeyedStream.md index 73586cfd2a..0639830e75 100644 --- a/docs/reference/type-aliases/NamespacedAndKeyedStream.md +++ b/docs/reference/type-aliases/NamespacedAndKeyedStream.md @@ -7,7 +7,7 @@ title: NamespacedAndKeyedStream type NamespacedAndKeyedStream = IStreamBuilder; ``` -Defined in: [packages/db/src/types.ts:1181](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1181) +Defined in: [packages/db/src/types.ts:1212](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1212) A namespaced and keyed stream is a stream of rows This is used throughout a query pipeline and as the output from a query without diff --git a/docs/reference/type-aliases/NamespacedRow.md b/docs/reference/type-aliases/NamespacedRow.md index 7ab6c519e2..a68a90bdbf 100644 --- a/docs/reference/type-aliases/NamespacedRow.md +++ b/docs/reference/type-aliases/NamespacedRow.md @@ -7,6 +7,6 @@ title: NamespacedRow type NamespacedRow = Record>; ``` -Defined in: [packages/db/src/types.ts:1168](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1168) +Defined in: [packages/db/src/types.ts:1199](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1199) A namespaced row is a row withing a pipeline that had each table wrapped in its alias diff --git a/docs/reference/type-aliases/NonSingleResult.md b/docs/reference/type-aliases/NonSingleResult.md index 707e031bfd..5f38e7aa32 100644 --- a/docs/reference/type-aliases/NonSingleResult.md +++ b/docs/reference/type-aliases/NonSingleResult.md @@ -7,7 +7,7 @@ title: NonSingleResult type NonSingleResult = object; ``` -Defined in: [packages/db/src/types.ts:1124](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1124) +Defined in: [packages/db/src/types.ts:1155](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1155) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/db/src/types.ts:1124](https://github.com/TanStack/db/blob/ optional singleResult: never; ``` -Defined in: [packages/db/src/types.ts:1125](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1125) +Defined in: [packages/db/src/types.ts:1156](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1156) diff --git a/docs/reference/type-aliases/OperatorCallback.md b/docs/reference/type-aliases/OperatorCallback.md index 2fdee056d3..4130693151 100644 --- a/docs/reference/type-aliases/OperatorCallback.md +++ b/docs/reference/type-aliases/OperatorCallback.md @@ -7,7 +7,7 @@ title: OperatorCallback type OperatorCallback = 0 extends 1 & TContext ? (refs) => any : TCallback; ``` -Defined in: [packages/db/src/query/builder/types.ts:662](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L662) +Defined in: [packages/db/src/query/builder/types.ts:659](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L659) A callback that an operator value receives before the query supplies its context. Without noImplicitAny, TypeScript skips that inference and the diff --git a/docs/reference/type-aliases/OptimisticChangeMessage.md b/docs/reference/type-aliases/OptimisticChangeMessage.md index 1a1e42571b..9c67bff577 100644 --- a/docs/reference/type-aliases/OptimisticChangeMessage.md +++ b/docs/reference/type-aliases/OptimisticChangeMessage.md @@ -9,7 +9,7 @@ type OptimisticChangeMessage = | DeleteKeyMessage & object; ``` -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:681](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L681) ## Type Parameters diff --git a/docs/reference/type-aliases/OrderByCallback.md b/docs/reference/type-aliases/OrderByCallback.md index 18c787bbd6..03495b95fc 100644 --- a/docs/reference/type-aliases/OrderByCallback.md +++ b/docs/reference/type-aliases/OrderByCallback.md @@ -7,7 +7,7 @@ title: OrderByCallback type OrderByCallback = (refs) => any; ``` -Defined in: [packages/db/src/query/builder/types.ts:616](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L616) +Defined in: [packages/db/src/query/builder/types.ts:613](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L613) OrderByCallback - Type for orderBy clause callback functions diff --git a/docs/reference/type-aliases/PooledLiveQueries.md b/docs/reference/type-aliases/PooledLiveQueries.md index fe08f04282..5fad30ece7 100644 --- a/docs/reference/type-aliases/PooledLiveQueries.md +++ b/docs/reference/type-aliases/PooledLiveQueries.md @@ -7,4 +7,4 @@ title: PooledLiveQueries type PooledLiveQueries = typeof pooledLiveQueries; ``` -Defined in: [packages/db/src/query/pooled-live-query.ts:883](https://github.com/TanStack/db/blob/main/packages/db/src/query/pooled-live-query.ts#L883) +Defined in: [packages/db/src/query/pooled-live-query.ts:897](https://github.com/TanStack/db/blob/main/packages/db/src/query/pooled-live-query.ts#L897) diff --git a/docs/reference/type-aliases/Prettify.md b/docs/reference/type-aliases/Prettify.md index 9e287ecf31..cfc44b1d88 100644 --- a/docs/reference/type-aliases/Prettify.md +++ b/docs/reference/type-aliases/Prettify.md @@ -7,7 +7,7 @@ title: Prettify type Prettify = { [K in keyof T]: T[K] } & object; ``` -Defined in: [packages/db/src/query/builder/types.ts:1408](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1408) +Defined in: [packages/db/src/query/builder/types.ts:1415](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1415) Prettify - Utility type for clean IDE display diff --git a/docs/reference/type-aliases/Ref.md b/docs/reference/type-aliases/Ref.md index 215ea634f3..ed738781ed 100644 --- a/docs/reference/type-aliases/Ref.md +++ b/docs/reference/type-aliases/Ref.md @@ -7,7 +7,7 @@ title: Ref type Ref = T extends unknown ? RefBranch : never; ``` -Defined in: [packages/db/src/query/builder/types.ts:937](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L937) +Defined in: [packages/db/src/query/builder/types.ts:932](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L932) Ref - The user-facing ref interface for the query builder diff --git a/docs/reference/type-aliases/RefsForContext.md b/docs/reference/type-aliases/RefsForContext.md index bbc594376b..b989211719 100644 --- a/docs/reference/type-aliases/RefsForContext.md +++ b/docs/reference/type-aliases/RefsForContext.md @@ -7,7 +7,7 @@ title: RefsForContext type RefsForContext = { [K in Exclude>, keyof JoinedRefsForContext | keyof BranchUnionResultRefs>]: RefForContextSchemaValue, K>, IsNullableContextKey> } & TContext["hasResult"] extends true ? object : object & BranchUnionResultRefs & JoinedRefsForContext; ``` -Defined in: [packages/db/src/query/builder/types.ts:799](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L799) +Defined in: [packages/db/src/query/builder/types.ts:796](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L796) ## Type Parameters diff --git a/docs/reference/type-aliases/ResultStream.md b/docs/reference/type-aliases/ResultStream.md index 65e1f0eaf6..ebc7f20d90 100644 --- a/docs/reference/type-aliases/ResultStream.md +++ b/docs/reference/type-aliases/ResultStream.md @@ -7,7 +7,7 @@ title: ResultStream type ResultStream = IStreamBuilder<[unknown, [any, string | undefined]]>; ``` -Defined in: [packages/db/src/types.ts:1163](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1163) +Defined in: [packages/db/src/types.ts:1194](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1194) Result stream type representing the output of compiled queries Always returns [key, [result, orderByIndex]] where orderByIndex is undefined for unordered queries diff --git a/docs/reference/type-aliases/ResultTypeFromSelect.md b/docs/reference/type-aliases/ResultTypeFromSelect.md index afc4261124..3448d5767d 100644 --- a/docs/reference/type-aliases/ResultTypeFromSelect.md +++ b/docs/reference/type-aliases/ResultTypeFromSelect.md @@ -7,7 +7,7 @@ title: ResultTypeFromSelect type ResultTypeFromSelect = IsAny extends true ? any : IsTrueRef extends true ? ExtractDirectSelectRef : WithoutRefBrand extends true ? ExtractExpressionType : TSelectObject[K] extends ToArrayWrapper ? T[] : TSelectObject[K] extends ConcatToArrayWrapper ? string : TSelectObject[K] extends MaterializeWrapper ? IsSingle extends true ? (...) | (...) : (...)[] : (...)[(...)] extends { __brand: ...; _result?: ... } ? ResultTypeFromCaseWhen<(...)> : (...) extends (...) ? (...) : (...) }>>; ``` -Defined in: [packages/db/src/query/builder/types.ts:440](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L440) +Defined in: [packages/db/src/query/builder/types.ts:437](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L437) ResultTypeFromSelect - Infers the result type from a select object diff --git a/docs/reference/type-aliases/SchemaFromSource.md b/docs/reference/type-aliases/SchemaFromSource.md index 2fff2d490f..0671b35fe6 100644 --- a/docs/reference/type-aliases/SchemaFromSource.md +++ b/docs/reference/type-aliases/SchemaFromSource.md @@ -7,7 +7,7 @@ title: SchemaFromSource type SchemaFromSource = Prettify<{ [K in keyof T]: T[K] extends CollectionImpl ? InferCollectionType : T[K] extends CollectionOptionsIdentity ? InferCollectionType : T[K] extends QueryBuilder ? GetRawResult : never }>; ``` -Defined in: [packages/db/src/query/builder/types.ts:132](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L132) +Defined in: [packages/db/src/query/builder/types.ts:129](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L129) SchemaFromSource - Converts a Source definition into a ContextSchema diff --git a/docs/reference/type-aliases/SelectObject.md b/docs/reference/type-aliases/SelectObject.md index 3acca6c988..af40d7434f 100644 --- a/docs/reference/type-aliases/SelectObject.md +++ b/docs/reference/type-aliases/SelectObject.md @@ -7,7 +7,7 @@ title: SelectObject type SelectObject = T; ``` -Defined in: [packages/db/src/query/builder/types.ts:304](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L304) +Defined in: [packages/db/src/query/builder/types.ts:301](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L301) SelectObject - Wrapper type for select clause objects diff --git a/docs/reference/type-aliases/SingleResult.md b/docs/reference/type-aliases/SingleResult.md index e17e1985f2..30f92425e6 100644 --- a/docs/reference/type-aliases/SingleResult.md +++ b/docs/reference/type-aliases/SingleResult.md @@ -7,7 +7,7 @@ title: SingleResult type SingleResult = object; ``` -Defined in: [packages/db/src/types.ts:1120](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1120) +Defined in: [packages/db/src/types.ts:1151](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1151) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/db/src/types.ts:1120](https://github.com/TanStack/db/blob/ singleResult: true; ``` -Defined in: [packages/db/src/types.ts:1121](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1121) +Defined in: [packages/db/src/types.ts:1152](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1152) diff --git a/docs/reference/type-aliases/SingleSource.md b/docs/reference/type-aliases/SingleSource.md index 4d67707522..048d65dd92 100644 --- a/docs/reference/type-aliases/SingleSource.md +++ b/docs/reference/type-aliases/SingleSource.md @@ -7,7 +7,7 @@ title: SingleSource type SingleSource = IsUnion extends true ? never : TSource; ``` -Defined in: [packages/db/src/query/builder/types.ts:152](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L152) +Defined in: [packages/db/src/query/builder/types.ts:149](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L149) ## Type Parameters diff --git a/docs/reference/type-aliases/Source.md b/docs/reference/type-aliases/Source.md index 16190f9745..e604cce893 100644 --- a/docs/reference/type-aliases/Source.md +++ b/docs/reference/type-aliases/Source.md @@ -7,7 +7,7 @@ title: Source type Source = object; ``` -Defined in: [packages/db/src/query/builder/types.ts:96](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L96) +Defined in: [packages/db/src/query/builder/types.ts:93](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L93) Source - Input definition for query builder `from()` and `unionAll()` clauses diff --git a/docs/reference/type-aliases/SourceClauseContext.md b/docs/reference/type-aliases/SourceClauseContext.md index df527bbc22..0b4783a832 100644 --- a/docs/reference/type-aliases/SourceClauseContext.md +++ b/docs/reference/type-aliases/SourceClauseContext.md @@ -7,4 +7,4 @@ title: SourceClauseContext type SourceClauseContext = "from clause" | "unionAll clause" | "join clause"; ``` -Defined in: [packages/db/src/errors.ts:653](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L653) +Defined in: [packages/db/src/errors.ts:658](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L658) diff --git a/docs/reference/type-aliases/StandardSchema.md b/docs/reference/type-aliases/StandardSchema.md index c10fcad8cb..3ee2bd3ed0 100644 --- a/docs/reference/type-aliases/StandardSchema.md +++ b/docs/reference/type-aliases/StandardSchema.md @@ -7,7 +7,7 @@ title: StandardSchema type StandardSchema = StandardSchemaV1 & object; ``` -Defined in: [packages/db/src/types.ts:658](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L658) +Defined in: [packages/db/src/types.ts:698](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L698) The Standard Schema interface. This follows the standard-schema specification: https://github.com/standard-schema/standard-schema diff --git a/docs/reference/type-aliases/StandardSchemaAlias.md b/docs/reference/type-aliases/StandardSchemaAlias.md index b36b4d8590..9628b899ac 100644 --- a/docs/reference/type-aliases/StandardSchemaAlias.md +++ b/docs/reference/type-aliases/StandardSchemaAlias.md @@ -7,7 +7,7 @@ title: StandardSchemaAlias type StandardSchemaAlias = StandardSchema; ``` -Defined in: [packages/db/src/types.ts:670](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L670) +Defined in: [packages/db/src/types.ts:710](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L710) Type alias for StandardSchema diff --git a/docs/reference/type-aliases/SyncAppliedReceipt.md b/docs/reference/type-aliases/SyncAppliedReceipt.md index 88b87eccee..7bce613d57 100644 --- a/docs/reference/type-aliases/SyncAppliedReceipt.md +++ b/docs/reference/type-aliases/SyncAppliedReceipt.md @@ -7,7 +7,7 @@ title: SyncAppliedReceipt type SyncAppliedReceipt = true | Promise; ``` -Defined in: [packages/db/src/types.ts:407](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L407) +Defined in: [packages/db/src/types.ts:408](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L408) Confirms that a committed sync transaction is visible, or resolves when it becomes visible. An accepted transaction always applies in commit order. A diff --git a/docs/reference/type-aliases/SyncConfigRes.md b/docs/reference/type-aliases/SyncConfigRes.md index 1eac0e4bac..c7caf535f6 100644 --- a/docs/reference/type-aliases/SyncConfigRes.md +++ b/docs/reference/type-aliases/SyncConfigRes.md @@ -7,7 +7,7 @@ title: SyncConfigRes type SyncConfigRes = object; ``` -Defined in: [packages/db/src/types.ts:431](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L431) +Defined in: [packages/db/src/types.ts:432](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L432) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/db/src/types.ts:431](https://github.com/TanStack/db/blob/m optional cleanup: CleanupFn; ``` -Defined in: [packages/db/src/types.ts:432](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L432) +Defined in: [packages/db/src/types.ts:433](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L433) *** @@ -27,7 +27,7 @@ Defined in: [packages/db/src/types.ts:432](https://github.com/TanStack/db/blob/m optional loadSubset: LoadSubsetFn; ``` -Defined in: [packages/db/src/types.ts:433](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L433) +Defined in: [packages/db/src/types.ts:434](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L434) *** @@ -37,7 +37,7 @@ Defined in: [packages/db/src/types.ts:433](https://github.com/TanStack/db/blob/m optional restartAfterScopedRecovery: (cacheRotated) => void | Promise; ``` -Defined in: [packages/db/src/types.ts:441](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L441) +Defined in: [packages/db/src/types.ts:442](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L442) Optional provider-controlled restart for a lost managed cache claim. Retire old provider callbacks synchronously and start the replacement only @@ -62,4 +62,4 @@ absent, the persistence wrapper cleans up and reenters `sync` itself. optional unloadSubset: UnloadSubsetFn; ``` -Defined in: [packages/db/src/types.ts:434](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L434) +Defined in: [packages/db/src/types.ts:435](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L435) diff --git a/docs/reference/type-aliases/SyncMode.md b/docs/reference/type-aliases/SyncMode.md index 10aa3542b4..06bb4b7789 100644 --- a/docs/reference/type-aliases/SyncMode.md +++ b/docs/reference/type-aliases/SyncMode.md @@ -7,4 +7,4 @@ title: SyncMode type SyncMode = "eager" | "on-demand"; ``` -Defined in: [packages/db/src/types.ts:787](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L787) +Defined in: [packages/db/src/types.ts:815](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L815) diff --git a/docs/reference/type-aliases/SyncPersistenceCapabilityV1.md b/docs/reference/type-aliases/SyncPersistenceCapabilityV1.md index c1813e95ee..0760b9acd9 100644 --- a/docs/reference/type-aliases/SyncPersistenceCapabilityV1.md +++ b/docs/reference/type-aliases/SyncPersistenceCapabilityV1.md @@ -7,7 +7,7 @@ title: SyncPersistenceCapabilityV1 type SyncPersistenceCapabilityV1 = object; ``` -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:602](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L602) **`Internal`** @@ -27,7 +27,7 @@ Unstable cross-package protocol for persistence-aware adapters. readonly hydrateBaseline: () => Promise; ``` -Defined in: [packages/db/src/types.ts:599](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L599) +Defined in: [packages/db/src/types.ts:611](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L611) #### Returns @@ -41,7 +41,7 @@ Defined in: [packages/db/src/types.ts:599](https://github.com/TanStack/db/blob/m readonly optional managedCacheGeneration: boolean; ``` -Defined in: [packages/db/src/types.ts:596](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L596) +Defined in: [packages/db/src/types.ts:608](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L608) This run owns a claimed on-demand cache generation. @@ -53,7 +53,7 @@ This run owns a claimed on-demand cache generation. readonly protocol: "@tanstack/db/sync-persistence"; ``` -Defined in: [packages/db/src/types.ts:593](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L593) +Defined in: [packages/db/src/types.ts:605](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L605) *** @@ -63,10 +63,23 @@ Defined in: [packages/db/src/types.ts:593](https://github.com/TanStack/db/blob/m readonly reserveCommitTurn: () => void; ``` -Defined in: [packages/db/src/types.ts:609](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L609) - -Reserve the open sync transaction's FIFO turn, so a subset hydration -that starts before it commits waits for that commit. +Defined in: [packages/db/src/types.ts:634](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L634) + +Reserve the open sync transaction's FIFO turn. Every persisted hydration +that would start before it commits waits for that commit: a subset load, +a reload or reset from a peer notice, and sequence-gap recovery. A subset +load admitted while the turn is reserved also runs after the commit's +durable write. The source must end the transaction: commit it, or abandon +it by committing with an aborted signal. An abandon releases the waiting +hydrations as a commit does, so they run. A peer reset abandons a +reserved transaction that began before the reset: its commit rejects +with `SyncTransactionAbortedError`, and the reset does not wait. +Sequence-gap recovery counts as a hydration only from the point where it +changes rows. A source that stops for good +abandons it, or every later hydration keeps waiting. The source must not +await a `hydrateBaseline` that it started before reserving while the +reservation is open: that baseline waits for the commit. Calling +`hydrateBaseline` while the reservation is open rejects. #### Returns @@ -80,7 +93,7 @@ that starts before it commits waits for that commit. readonly resumeSnapshot: object; ``` -Defined in: [packages/db/src/types.ts:613](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L613) +Defined in: [packages/db/src/types.ts:638](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L638) #### certify() @@ -102,6 +115,36 @@ readonly expectCurrentCommit: () => void; `void` +#### expectSourceProgress()? + +```ts +readonly optional expectSourceProgress: (progress) => void; +``` + +Atomically compare the durable source token with this transaction's +predecessor. The source stages its next opaque string token in collection +metadata at `key`. A discontinuity invalidates source progress evidence +until an authoritative truncate; rows and receipts still apply normally. +Re-delivering the same complete source position must be idempotent; it +preserves existing evidence, including an earlier incompatibility. +Only adapters that implement the durable comparison expose this method. + +##### Parameters + +###### progress + +###### key + +`string` + +###### previous + +`string` \| `undefined` + +##### Returns + +`void` + #### getKeySetEvidence() ```ts @@ -115,6 +158,18 @@ readonly getKeySetEvidence: () => \| [`SyncPersistenceKeySetEvidence`](SyncPersistenceKeySetEvidence.md) \| `undefined` +#### getSourceProgressCompatible()? + +```ts +readonly optional getSourceProgressCompatible: () => boolean | undefined; +``` + +Source progress evidence from the atomic persisted resume snapshot. + +##### Returns + +`boolean` \| `undefined` + *** ### scanPersistedRows() @@ -123,7 +178,7 @@ readonly getKeySetEvidence: () => readonly scanPersistedRows: (options?) => Promise[]>; ``` -Defined in: [packages/db/src/types.ts:610](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L610) +Defined in: [packages/db/src/types.ts:635](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L635) #### Parameters @@ -143,7 +198,7 @@ Defined in: [packages/db/src/types.ts:610](https://github.com/TanStack/db/blob/m readonly optional startScopedRecovery: (resetMetadata?) => Promise; ``` -Defined in: [packages/db/src/types.ts:601](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L601) +Defined in: [packages/db/src/types.ts:613](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L613) Retire untrusted on-demand rows and retain the provider's reset metadata. @@ -171,7 +226,7 @@ Retire untrusted on-demand rows and retain the provider's reset metadata. readonly optional startupCacheGenerationRotated: boolean; ``` -Defined in: [packages/db/src/types.ts:598](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L598) +Defined in: [packages/db/src/types.ts:610](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L610) The on-demand cache generation rotated before the source sync run entered. @@ -183,4 +238,4 @@ The on-demand cache generation rotated before the source sync run entered. readonly version: 1; ``` -Defined in: [packages/db/src/types.ts:594](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L594) +Defined in: [packages/db/src/types.ts:606](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L606) diff --git a/docs/reference/type-aliases/SyncPersistenceKeySetEvidence.md b/docs/reference/type-aliases/SyncPersistenceKeySetEvidence.md index cc0c31d8bc..5ad7420f48 100644 --- a/docs/reference/type-aliases/SyncPersistenceKeySetEvidence.md +++ b/docs/reference/type-aliases/SyncPersistenceKeySetEvidence.md @@ -7,7 +7,7 @@ title: SyncPersistenceKeySetEvidence type SyncPersistenceKeySetEvidence = object; ``` -Defined in: [packages/db/src/types.ts:571](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L571) +Defined in: [packages/db/src/types.ts:583](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L583) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/db/src/types.ts:571](https://github.com/TanStack/db/blob/m status: "unknown" | "consistent" | "incompatible"; ``` -Defined in: [packages/db/src/types.ts:572](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L572) +Defined in: [packages/db/src/types.ts:584](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L584) diff --git a/docs/reference/type-aliases/SyncPersistenceScanOptions.md b/docs/reference/type-aliases/SyncPersistenceScanOptions.md index 2cb2b7e663..504226c784 100644 --- a/docs/reference/type-aliases/SyncPersistenceScanOptions.md +++ b/docs/reference/type-aliases/SyncPersistenceScanOptions.md @@ -7,7 +7,7 @@ title: SyncPersistenceScanOptions type SyncPersistenceScanOptions = object; ``` -Defined in: [packages/db/src/types.ts:575](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L575) +Defined in: [packages/db/src/types.ts:587](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L587) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/db/src/types.ts:575](https://github.com/TanStack/db/blob/m optional metadataOnly: boolean; ``` -Defined in: [packages/db/src/types.ts:576](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L576) +Defined in: [packages/db/src/types.ts:588](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L588) diff --git a/docs/reference/type-aliases/SyncPersistenceScannedRow.md b/docs/reference/type-aliases/SyncPersistenceScannedRow.md index dcdd7cb6d5..d327faaa5e 100644 --- a/docs/reference/type-aliases/SyncPersistenceScannedRow.md +++ b/docs/reference/type-aliases/SyncPersistenceScannedRow.md @@ -7,7 +7,7 @@ title: SyncPersistenceScannedRow type SyncPersistenceScannedRow = object; ``` -Defined in: [packages/db/src/types.ts:579](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L579) +Defined in: [packages/db/src/types.ts:591](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L591) ## Type Parameters @@ -23,7 +23,7 @@ Defined in: [packages/db/src/types.ts:579](https://github.com/TanStack/db/blob/m key: TKey; ``` -Defined in: [packages/db/src/types.ts:582](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L582) +Defined in: [packages/db/src/types.ts:594](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L594) *** @@ -33,7 +33,7 @@ Defined in: [packages/db/src/types.ts:582](https://github.com/TanStack/db/blob/m optional metadata: unknown; ``` -Defined in: [packages/db/src/types.ts:584](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L584) +Defined in: [packages/db/src/types.ts:596](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L596) *** @@ -43,4 +43,4 @@ Defined in: [packages/db/src/types.ts:584](https://github.com/TanStack/db/blob/m value: object; ``` -Defined in: [packages/db/src/types.ts:583](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L583) +Defined in: [packages/db/src/types.ts:595](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L595) diff --git a/docs/reference/type-aliases/UnloadSubsetFn.md b/docs/reference/type-aliases/UnloadSubsetFn.md index 8d4804d6eb..bc444f584e 100644 --- a/docs/reference/type-aliases/UnloadSubsetFn.md +++ b/docs/reference/type-aliases/UnloadSubsetFn.md @@ -7,7 +7,7 @@ title: UnloadSubsetFn type UnloadSubsetFn = (options) => void; ``` -Defined in: [packages/db/src/types.ts:417](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L417) +Defined in: [packages/db/src/types.ts:418](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L418) Releases the exact acquisition created for `options`. diff --git a/docs/reference/type-aliases/UpdateMutationFn.md b/docs/reference/type-aliases/UpdateMutationFn.md index ad9137b2a5..e83cec4f19 100644 --- a/docs/reference/type-aliases/UpdateMutationFn.md +++ b/docs/reference/type-aliases/UpdateMutationFn.md @@ -4,10 +4,10 @@ title: UpdateMutationFn --- ```ts -type UpdateMutationFn = (params) => Promise; +type UpdateMutationFn = (params) => Promise; ``` -Defined in: [packages/db/src/types.ts:735](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L735) +Defined in: [packages/db/src/types.ts:768](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L768) ## Type Parameters @@ -23,12 +23,6 @@ Defined in: [packages/db/src/types.ts:735](https://github.com/TanStack/db/blob/m `TUtils` *extends* [`UtilsRecord`](UtilsRecord.md) = [`UtilsRecord`](UtilsRecord.md) -### TReturn - -`TReturn` = `any` - -DEPRECATED: Return values are kept for backward compatibility and will be removed in v1.0. - ## Parameters ### params @@ -37,4 +31,4 @@ DEPRECATED: Return values are kept for backward compatibility and will be remove ## Returns -`Promise`\<`TReturn`\> +`Promise`\<`void`\> diff --git a/docs/reference/type-aliases/UpdateMutationFnParams.md b/docs/reference/type-aliases/UpdateMutationFnParams.md index 133af05423..87258c0e07 100644 --- a/docs/reference/type-aliases/UpdateMutationFnParams.md +++ b/docs/reference/type-aliases/UpdateMutationFnParams.md @@ -7,7 +7,7 @@ title: UpdateMutationFnParams type UpdateMutationFnParams = object; ``` -Defined in: [packages/db/src/types.ts:684](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L684) +Defined in: [packages/db/src/types.ts:724](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L724) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/db/src/types.ts:684](https://github.com/TanStack/db/blob/m collection: Collection; ``` -Defined in: [packages/db/src/types.ts:694](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L694) +Defined in: [packages/db/src/types.ts:734](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L734) *** @@ -41,4 +41,4 @@ Defined in: [packages/db/src/types.ts:694](https://github.com/TanStack/db/blob/m transaction: TransactionWithMutations>; ``` -Defined in: [packages/db/src/types.ts:689](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L689) +Defined in: [packages/db/src/types.ts:729](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L729) diff --git a/docs/reference/type-aliases/WhereCallback.md b/docs/reference/type-aliases/WhereCallback.md index f383b83bd1..d6f848ef6f 100644 --- a/docs/reference/type-aliases/WhereCallback.md +++ b/docs/reference/type-aliases/WhereCallback.md @@ -7,7 +7,7 @@ title: WhereCallback type WhereCallback = (refs) => any; ``` -Defined in: [packages/db/src/query/builder/types.ts:219](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L219) +Defined in: [packages/db/src/query/builder/types.ts:216](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L216) WhereCallback - Type for where/having clause callback functions diff --git a/docs/reference/type-aliases/WithResult.md b/docs/reference/type-aliases/WithResult.md index 20efbc013c..178043b803 100644 --- a/docs/reference/type-aliases/WithResult.md +++ b/docs/reference/type-aliases/WithResult.md @@ -7,7 +7,7 @@ title: WithResult type WithResult = Prettify & Pick & object>; ``` -Defined in: [packages/db/src/query/builder/types.ts:1397](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1397) +Defined in: [packages/db/src/query/builder/types.ts:1404](https://github.com/TanStack/db/blob/main/packages/db/src/query/builder/types.ts#L1404) WithResult - Updates a context with a new result type after select() diff --git a/docs/reference/type-aliases/WithVirtualProps.md b/docs/reference/type-aliases/WithVirtualProps.md index 3ae1e8ba71..1d6dcb5ead 100644 --- a/docs/reference/type-aliases/WithVirtualProps.md +++ b/docs/reference/type-aliases/WithVirtualProps.md @@ -4,10 +4,10 @@ title: WithVirtualProps --- ```ts -type WithVirtualProps = T & PublishedVirtualRowProps; +type WithVirtualProps = T & VirtualRowProps; ``` -Defined in: [packages/db/src/virtual-props.ts:157](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L157) +Defined in: [packages/db/src/virtual-props.ts:132](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L132) Adds virtual properties to a row type. @@ -30,6 +30,5 @@ The type of the row's key ```typescript type User = { id: string; name: string } type UserWithVirtual = WithVirtualProps -// { id: string; name: string; $hasPendingWrites: boolean; $synced: boolean; $origin: 'local' | 'remote'; $key: string; $collectionId: string } -// $synced is deprecated; use !$hasPendingWrites instead. +// { id: string; name: string; $hasPendingWrites: boolean; $origin: 'local' | 'remote'; $key: string; $collectionId: string } ``` diff --git a/docs/reference/type-aliases/WithoutVirtualProps.md b/docs/reference/type-aliases/WithoutVirtualProps.md index 3d07741cbd..107fdec8f3 100644 --- a/docs/reference/type-aliases/WithoutVirtualProps.md +++ b/docs/reference/type-aliases/WithoutVirtualProps.md @@ -7,7 +7,7 @@ title: WithoutVirtualProps type WithoutVirtualProps = T extends unknown ? Omit : never; ``` -Defined in: [packages/db/src/virtual-props.ts:175](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L175) +Defined in: [packages/db/src/virtual-props.ts:150](https://github.com/TanStack/db/blob/main/packages/db/src/virtual-props.ts#L150) Extracts the base type from a type that may have virtual properties. Useful when you need to work with the raw data without virtual properties. diff --git a/docs/reference/type-aliases/WritableDeep.md b/docs/reference/type-aliases/WritableDeep.md index 86b8469884..b531460001 100644 --- a/docs/reference/type-aliases/WritableDeep.md +++ b/docs/reference/type-aliases/WritableDeep.md @@ -7,7 +7,7 @@ title: WritableDeep type WritableDeep = T extends BuiltIns ? T : T extends (...arguments_) => unknown ? object extends WritableObjectDeep ? T : HasMultipleCallSignatures extends true ? T : (...arguments_) => ReturnType & WritableObjectDeep : T extends ReadonlyMap ? WritableMapDeep : T extends ReadonlySet ? WritableSetDeep : T extends ReadonlyArray ? WritableArrayDeep : T extends object ? WritableObjectDeep : unknown; ``` -Defined in: [packages/db/src/types.ts:1392](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1392) +Defined in: [packages/db/src/types.ts:1427](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1427) ## Type Parameters diff --git a/docs/reference/variables/pooledLiveQueries.md b/docs/reference/variables/pooledLiveQueries.md index 3911f0861c..550e6853fc 100644 --- a/docs/reference/variables/pooledLiveQueries.md +++ b/docs/reference/variables/pooledLiveQueries.md @@ -7,7 +7,7 @@ title: pooledLiveQueries const pooledLiveQueries: object; ``` -Defined in: [packages/db/src/query/pooled-live-query.ts:878](https://github.com/TanStack/db/blob/main/packages/db/src/query/pooled-live-query.ts#L878) +Defined in: [packages/db/src/query/pooled-live-query.ts:892](https://github.com/TanStack/db/blob/main/packages/db/src/query/pooled-live-query.ts#L892) Pooled live queries for framework hooks. Pass it as `pool` in a hook's query config to serve equality-filtered queries of one shape from a shared diff --git a/docs/reference/variables/syncWriteNamesWholeRow.md b/docs/reference/variables/syncWriteNamesWholeRow.md new file mode 100644 index 0000000000..d0adab7757 --- /dev/null +++ b/docs/reference/variables/syncWriteNamesWholeRow.md @@ -0,0 +1,16 @@ +--- +id: syncWriteNamesWholeRow +title: syncWriteNamesWholeRow +--- + +```ts +const syncWriteNamesWholeRow: unique symbol; +``` + +Defined in: [packages/db/src/collection/sync.ts:51](https://github.com/TanStack/db/blob/main/packages/db/src/collection/sync.ts#L51) + +**`Internal`** + +Internal marker on a sync write: an update that names the whole row, as an +insert does. The persisted wrapper hands an insert it already judged this +way. It is not part of the public sync API.