You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-02 22:49:09 +02:00
Desktop: Resolves #206: Added support for sorting notebooks by title or last modified
This commit is contained in:
@@ -100,6 +100,17 @@ class Database {
|
||||
return this.tryCall('selectAll', sql, params);
|
||||
}
|
||||
|
||||
async selectAllFields(sql, params, field) {
|
||||
const rows = await this.tryCall('selectAll', sql, params);
|
||||
const output = [];
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
const v = rows[i][field];
|
||||
if (!v) throw new Error('No such field: ' + field + '. Query was: ' + sql);
|
||||
output.push(rows[i][field]);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
async exec(sql, params = null) {
|
||||
return this.tryCall('exec', sql, params);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user