ChemPal Documentation - v1.6.0
    Preparing search index...

    Function getMigrationDb

    • Open the ChemPal database as an untyped idb handle for migration steps. Unlike getDB, this returns IDBPDatabase without the schema generic, so step code can read and write records in stores whose current-schema shape no longer matches the data on disk (renamed stores, old record shapes) using plain string store names — no type assertions required. The structural schema is still owned by getDB's upgrade; this connection never upgrades.

      Returns Promise<IDBPDatabase<unknown>>

      A fresh untyped connection to the same chempal database.

      const db = await getMigrationDb();
      const rows = await db.getAll("supplier_query_cache");
      export async function getMigrationDb(): Promise<IDBPDatabase> {
      return openDB(DB_NAME, DB_VERSION);
      }