summaryrefslogtreecommitdiff
path: root/ext/bg/js/database.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/database.js')
-rw-r--r--ext/bg/js/database.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index 5931e172..0621f1d6 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -39,6 +39,18 @@ class Database {
return this.db.open();
}
+ purge() {
+ if (this.db === null) {
+ return Promise.reject('database not initialized');
+ }
+
+ this.db.close();
+ return this.db.delete().then(() => {
+ this.db = null;
+ this.prepare();
+ });
+ }
+
findTerm(term, dictionaries) {
if (this.db === null) {
return Promise.reject('database not initialized');