An map containing defined object stores, and methods to perform action on object stores
Access object stores :
const { Todo } = DB.objectStores;
Iterate over data base object stores :
await DataBase.objectStores.methods.iterate((objectStore) => { /\* Some async operation *\/ })
Delete an indexed database
await DataBase.delete("task one")
Initialize an indexed data base
Data base name
Data base Version
Initialize objectStore(s)
An indexed data base that contains defined object store
Creating single object Store :
const DB = IDB.init("TodoDataBase", 1, { name: "Todo", options: { keyPath: "id" } });
Create multiple object Stores :
const DB = IDB.init("TodoDataBase", 1, [ { name: "Todo" }, {name: "Notes", options: { keyPath: "id" }} ]);
Use a callback function to initialize object stores :
const DB = IDB.init("TodoDataBase", 1, () => {
return { name: "Todo", options: { autoIncrement: true } };
// or returns objectStores list:
return [ { name: "Todo" }, { name: "Note" } ]
});
Generated using TypeDoc
Retrieves data base object stores and methods map