Add Zotero.DB.quickCheck(), and speed up integrityCheck()

https://www.sqlite.org/pragma.html#pragma_quick_check

And limit both checks to 1 error (e.g., integrity_check(1))
This commit is contained in:
Dan Stillman 2020-06-21 05:21:48 -04:00
parent eab9252550
commit b4320fbc4c

View file

@ -857,8 +857,14 @@ Zotero.DBConnection.prototype.info = Zotero.Promise.coroutine(function* () {
});
Zotero.DBConnection.prototype.quickCheck = async function () {
var ok = await this.valueQueryAsync("PRAGMA quick_check(1)");
return ok == 'ok';
};
Zotero.DBConnection.prototype.integrityCheck = Zotero.Promise.coroutine(function* () {
var ok = yield this.valueQueryAsync("PRAGMA integrity_check");
var ok = yield this.valueQueryAsync("PRAGMA integrity_check(1)");
return ok == 'ok';
});