Skip to content

Dexie.exists()

David Fahlander edited this page Apr 4, 2016 · 10 revisions

Since v1.2

Syntax

Dexie.exists(dbName)

Return Value

Promise<boolean>

Description

Checks whether a database with the given name exists or not. Returns a Promise that resolves with true or false.

Sample

Dexie.exists("myDatabase")
.then(function(exists) {
    if (exists)
        console.log("Database exists");
    else
        console.log("Database doesnt exist");
}).catch(function (error) {
    console.error("Oops, an error occurred when trying to check database existance");
});
Clone this wiki locally