@bodil/bdb
    Preparing search index...

    Class IndexedDBBackend

    Storage backend using an IndexedDB database.

    Use IndexedDBBackend.open to obtain a storage backend connected to the specified IndexedDB database.

    // Connect to the IndexedDB database.
    const storage = await IndexedDBBackend.open("my-docs", 1);
    // Declare a document type.
    type Document = { id: string; value: number };
    // Create the table.
    const docs = Table.create<Document>()
    .withPrimaryKey(index<Document>().key("id"))
    // Connect the table to our storage.
    .withStorage(storage);
    // Wait until the table has finished syncing with the storage.
    await docs.ready;
    // Ready for use!
    docs.add({ id: "Robert", value: 9001 });

    Hierarchy (View Summary)

    Constructors

    Properties

    name: string
    table: string
    version: number

    Methods