DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/type-aliases/CollectionStatus.md
CollectionStatus
ts
type CollectionStatus = "idle" | "loading" | "ready" | "error" | "crashed" | "cleaned-up";Defined in: packages/db/src/types.ts:769
Collection status values for lifecycle management
Examples#
ts
// Check collection status
if (collection.status === "loading") {
console.log("Collection is loading initial data")
} else if (collection.status === "ready") {
console.log("Collection is ready for use")
}ts
// Status transitions
// idle → loading → ready (when markReady() is called)
// loading → error when the sync adapter calls fail() before the first ready
// any active status → crashed when local storage or an invariant breaks
// After the first ready, sync problems appear in `health`, not in `status`.