Skip to content

Dexie.delete()

Christopher Hunt edited this page Dec 6, 2016 · 3 revisions

Syntax

db.delete();
// Static method
Dexie.delete('database_name');

Return Value

Promise

Description

Deletes the database and calls the then() method of the returned Promise when done. If the database does not exist (db.open() was never called) this method will also succeed.

Sample

db.delete().then(() => {
    console.log("Database successfully deleted");
}).catch((err) => {
    console.error("Could not delete database");
}).finally(() => {
    // Do what should be done next...
});
Clone this wiki locally