Member Junction
    Preparing search index...

    IndexedDB storage provider with category support via separate object stores.

    Native object storage: values pass through IndexedDB's structured clone algorithm — no JSON.stringify/parse round-trip. This preserves Date, Map, Set, typed arrays, nested objects, and is significantly faster than JSON (parse/serialize implemented in browser-native C++ vs. JS-level JSON).

    Class instances lose their prototype — store the raw data form (e.g. via entity.GetAll() for BaseEntity). This matches how the cache layer above already operates.

    Schema upgrades are version-driven: bumping IDB_DB_VERSION (auto-derived from the package's minor version) fires onupgradeneeded on the next page load, wipes all stores, and recreates them. Stale entries from any prior schema are gone in one atomic transition; no backward-compat read paths.

    Known categories (mj:Metadata, mj:RunViewCache, etc.) get dedicated stores; unknown categories share mj:default with prefixed keys.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    • Retrieves a value from storage. The implementation is responsible for any deserialization required by the underlying medium:

      • IndexedDB: returns the value directly via structured clone (Date/Map/Set/typed arrays preserved, no parse needed)
      • localStorage / Redis: deserializes from JSON internally
      • In-memory: returns the stored reference

      Returns null for missing keys or corrupt entries.

      Type Parameters

      • T = unknown

        Expected type of the stored value. Caller-controlled — the provider does not validate the runtime shape against this type. Falls back to unknown.

      Parameters

      • key: string

        The key to retrieve

      • Optionalcategory: string

        Optional category for key isolation (e.g., 'RunViewCache', 'Metadata')

      Returns Promise<T>

    • Batched read using a single IndexedDB transaction. The IndexedDB engine serializes transactions on the same object store, so Promise.all([...N gets]) actually pays per-transaction setup overhead (~3–10ms each in most browsers). Issuing all get() calls inside one transaction amortizes that overhead — for 85 keys, this is the difference between ~425ms of IDB bookkeeping and ~10ms.

      Inputs are deduplicated (same key requested twice → one read, one map entry). Missing keys map to null.

      Type Parameters

      • T = unknown

      Parameters

      • keys: string[]
      • Optionalcategory: string

      Returns Promise<Map<string, T>>

    • Stores a value. Callers should pass plain data (objects/arrays/primitives/Date/etc). Implementations handle any serialization required by the medium:

      • IndexedDB: stores natively via structured clone (no string conversion)
      • localStorage / Redis: serializes to JSON internally
      • In-memory: stores the reference directly

      Class instances lose their prototype on retrieval — store the underlying data (e.g. via entity.GetAll()) and reconstruct on read if needed.

      Type Parameters

      • T

        Type of the value being stored. Caller-controlled.

      Parameters

      • key: string

        The key to store under

      • value: T

        The value to store

      • Optionalcategory: string

        Optional category for key isolation

      Returns Promise<void>