Table of Contents

Importance

Open at App Start

// Example open with indexes, versioning is auto
// one -> single value
// one -> single value and unique
// arr -> array field
// arr_u -> array field and unique
idb.open("myapp",{
    store1:[
        "Name",one, "Age",one, ["Name","Age"],one, "Phone",one_u
    ]
});

Reopen and Query

var Db = await idb.reopen("mydb"); // Empty param if already in window.Db_Name
var Trans = Db.transaction("mystore",RW); // or RO
await idb.insert_one(Trans,{foo:"bar"});
idb.close(Db); // Must or dangling connection