You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
Chore: Migrate SQL queries in preparation for web support (#10670)
This commit is contained in:
@@ -346,7 +346,7 @@ class BaseModel {
|
||||
if (!options.fields) options.fields = '*';
|
||||
|
||||
let sql = `SELECT ${this.db().escapeFields(options.fields)} FROM \`${this.tableName()}\``;
|
||||
sql += ` WHERE id IN ("${ids.join('","')}")`;
|
||||
sql += ` WHERE id IN ('${ids.join('\',\'')}')`;
|
||||
const q = this.applySqlOptions(options, sql);
|
||||
return this.modelSelectAll(q.sql);
|
||||
}
|
||||
@@ -745,7 +745,7 @@ class BaseModel {
|
||||
|
||||
options = this.modOptions(options);
|
||||
const idFieldName = options.idFieldName ? options.idFieldName : 'id';
|
||||
const sql = `DELETE FROM ${this.tableName()} WHERE ${idFieldName} IN ("${ids.join('","')}")`;
|
||||
const sql = `DELETE FROM ${this.tableName()} WHERE ${idFieldName} IN ('${ids.join('\',\'')}')`;
|
||||
await this.db().exec(sql);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user