Defined in: packages/db/src/live-query-observer.ts:17
The canonical, adapter-agnostic view of a live query at a point in time.
getSnapshot() returns a stable object identity that only changes when the query changes, so useSyncExternalStore-style consumers can compare by reference. Each snapshot owns a captured view of state/data, so reading an older snapshot cannot expose rows from a later revision.
T extends object
TKey extends string | number
collection:
| Collection<T, TKey, any, StandardSchemaV1<unknown, unknown>, T>
| undefined;Defined in: packages/db/src/live-query-observer.ts:26
The underlying collection, or undefined when disabled.
data: T | readonly T[] | undefined;Defined in: packages/db/src/live-query-observer.ts:24
Ordered results (single row for findOne), or undefined when disabled.
isCleanedUp: boolean;Defined in: packages/db/src/live-query-observer.ts:43
isEnabled: boolean;Defined in: packages/db/src/live-query-observer.ts:44
isError: boolean;Defined in: packages/db/src/live-query-observer.ts:42
isIdle: boolean;Defined in: packages/db/src/live-query-observer.ts:41
isLoading: boolean;Defined in: packages/db/src/live-query-observer.ts:39
isReady: boolean;Defined in: packages/db/src/live-query-observer.ts:40
layoutRevision: number;Defined in: packages/db/src/live-query-observer.ts:37
Monotonic counter bumped whenever the visible layout (the ordered key sequence) changes — membership, ordering, or an order-only move. Lets consumers detect a reorder that changed no row value (which data/state identity alone can't express once row values are structurally shared).
It is NOT in lockstep with snapshot identity: a value-only update produces a new snapshot while layoutRevision stays put. A layoutRevision change always accompanies a new snapshot, but not vice versa.
state: ReadonlyMap<TKey, T> | undefined;Defined in: packages/db/src/live-query-observer.ts:22
Keyed results, or undefined for a disabled query.
status: CollectionStatus | "disabled";Defined in: packages/db/src/live-query-observer.ts:38