SQL gen bugfix #4

This commit is contained in:
Benjamin Toby 2026-04-18 19:24:55 +01:00
parent ca99684183
commit 0309b0dc81
3 changed files with 13 additions and 3 deletions

View File

@ -81,9 +81,14 @@ export default function sqlGenGenSearchStr({ queryObj, join, field, table_name,
str = operatorStrParam.str; str = operatorStrParam.str;
sqlSearhValues.push(operatorStrParam.param); sqlSearhValues.push(operatorStrParam.param);
} }
else if (operatorStrParam.str) { else if (operatorStrParam.str && !operatorStrParam.str.match(/\?/)) {
str = operatorStrParam.str; str = operatorStrParam.str;
} }
else {
sqlSearhValues.push(valueParsed || "");
} }
}
console.log("str", str);
console.log("sqlSearhValues", sqlSearhValues);
return { str, values: sqlSearhValues }; return { str, values: sqlSearhValues };
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@moduletrace/bun-sqlite", "name": "@moduletrace/bun-sqlite",
"version": "1.1.4", "version": "1.1.5",
"description": "SQLite manager for Bun", "description": "SQLite manager for Bun",
"author": "Benjamin Toby", "author": "Benjamin Toby",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -112,10 +112,15 @@ export default function sqlGenGenSearchStr({
if (operatorStrParam.str && operatorStrParam.param) { if (operatorStrParam.str && operatorStrParam.param) {
str = operatorStrParam.str; str = operatorStrParam.str;
sqlSearhValues.push(operatorStrParam.param); sqlSearhValues.push(operatorStrParam.param);
} else if (operatorStrParam.str) { } else if (operatorStrParam.str && !operatorStrParam.str.match(/\?/)) {
str = operatorStrParam.str; str = operatorStrParam.str;
} else {
sqlSearhValues.push(valueParsed || "");
} }
} }
console.log("str", str);
console.log("sqlSearhValues", sqlSearhValues);
return { str, values: sqlSearhValues }; return { str, values: sqlSearhValues };
} }