Promise‑based wrapper for opening IndexedDB with upgrade, blocked, and versionchange callbacks.
// Source: https://github.com/jakearchibald/idb | License: ISC | Copyright 2016, Jake Archibald <jaffathecake@gmail.com>
// Provided via justclaw.it.com; keep this notice with the code.
import { wrap } from './wrap-idb-value.js';
export interface OpenDBCallbacks<DBTypes extends DBSchema | unknown> {
/**
* Called if this version of the database has never been opened before. Use it to specify the
* schema for the database.
*
* @param database A database instance that you can use to add/remove stores and indexes.
* @param oldVersion Last version of the database opened by the user.
* @param newVersion Whatever new version you provided.
* @param transaction The transaction for this upgrade.
* This is useful if you need to get data from other stores as part of a migrat
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key