@arkade-os/sdk Documentation - v0.5.0-rc.11
    Preparing search index...

    Function createManagedConnection

    • Forget-and-reopen around openDatabase, shared by every IndexedDB repository. Caching the resolved IDBDatabase is the defect this exists to remove: once the manager closes on versionchange, every later transaction on that handle throws InvalidStateError with no path back.

      Opens nothing until the first ManagedConnection.get — repositories construct their storage in their own constructors, and an eager open would move the "IndexedDB is not available in this environment" throw to construction time.

      Parameters

      • dbName: string
      • version: number
      • initDatabase: (
            db: IDBDatabase,
            oldVersion: number,
            transaction: IDBTransaction | null,
        ) => void

      Returns ManagedConnection