Skip to content

Dexie.exists()

David Fahlander edited this page Sep 22, 2015 · 10 revisions

Syntax

db.exists(dnName)

Return Value

Promise<bool>

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