converted most dynamic SQL queries into prepared statement to avoid excessive statement caching

This commit is contained in:
zadam
2020-06-20 23:24:34 +02:00
parent 969f31dde2
commit 5f699cc28c
6 changed files with 13 additions and 20 deletions

View File

@@ -97,7 +97,7 @@ function getAttributeNames(type, nameLike) {
FROM attributes
WHERE isDeleted = 0
AND type = ?
AND name LIKE '%${utils.sanitizeSql(nameLike)}%'`, [type]);
AND name LIKE ?`, [type, '%' + nameLike + '%']);
for (const attr of BUILTIN_ATTRIBUTES) {
if (attr.type === type && attr.name.toLowerCase().includes(nameLike) && !names.includes(attr.name)) {