You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
All: Allow disabling encryption and added more test cases
This commit is contained in:
@ -96,8 +96,11 @@ class BaseModel {
|
||||
return options;
|
||||
}
|
||||
|
||||
static count() {
|
||||
return this.db().selectOne('SELECT count(*) as total FROM `' + this.tableName() + '`').then((r) => {
|
||||
static count(options = null) {
|
||||
if (!options) options = {};
|
||||
let sql = 'SELECT count(*) as total FROM `' + this.tableName() + '`';
|
||||
if (options.where) sql += ' WHERE ' + options.where;
|
||||
return this.db().selectOne(sql).then((r) => {
|
||||
return r ? r['total'] : 0;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user