Member Junction
    Preparing search index...

    Interface CachedRunViewData

    Structure of cached RunView data stored in the storage provider. Note: rowCount is NOT persisted - it is always derived from results.length to prevent data inconsistency.

    interface CachedRunViewData {
        aggregateResults?: AggregateResult[];
        maxUpdatedAt: string;
        providerInternalScaffolding?: boolean;
        results: unknown[];
        schemaHash?: string;
        totalRowCount?: number;
    }
    Index

    Properties

    aggregateResults?: AggregateResult[]

    Cached aggregate results, if aggregates were requested

    maxUpdatedAt: string

    The maximum __mj_UpdatedAt timestamp from the results

    providerInternalScaffolding?: boolean

    Set when the slot was written with CacheWriteOptions.ProviderInternalScaffolding. Persisted so that in-place slot maintenance (storeCachedResults, driven by BaseEntity save/delete events) can carry the exemption FORWARD. Without it, the first save event touching a scaffolding slot would freeze it and break the owner that mutates those rows.

    results: unknown[]

    The cached result rows.

    ⚠️ These rows are SHARED: under a reference-sharing storage provider (see ILocalStorageProvider.SharesReferences) they are the same objects held by every reader of this slot, and they are deep-frozen at write time. Mutating one corrupts process-wide state and throws a TypeError. Build a new array / new rows instead.

    Deliberately typed mutable rather than readonly: the runtime freeze is the enforcement, and a readonly marker here would be a compile break for existing downstream code that reads cache entries — without adding protection the freeze does not already provide.

    schemaHash?: string

    Hash of the entity's field names (in sequence order) at the time the cache entry was written. Used to detect schema changes (e.g., new columns added via migration + CodeGen) that would make the cached data structurally stale even though maxUpdatedAt and rowCount haven't changed. Backward-compatible: entries without this field are served normally (no regression).

    totalRowCount?: number

    Total row count from the database — may differ from results.length for paginated queries