@arkade-os/sdk Documentation - v0.4.21
    Preparing search index...

    Function openDatabase

    • Opens an IndexedDB database and increments the reference count. Handles global object detection and callbacks.

      Parameters

      • dbName: string

        The name of the database to open.

      • dbVersion: number

        The database version to open.

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

        A function that migrates the database schema, called on onupgradeneeded only. Receives the database, the previous version (0 for fresh installs), and the upgrade transaction — the transaction is required for data migrations (cursor/update on existing stores).

      Returns Promise<IDBDatabase>

      A promise that resolves to the database instance.