1
0
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:
Henry Heino
2024-07-01 10:56:40 -07:00
committed by GitHub
parent 337d50437b
commit d89be23069
14 changed files with 33 additions and 33 deletions

View File

@@ -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);
}