This commit is contained in:
2026-02-11 07:36:42 +01:00
parent 2741214db8
commit fd83f6ab1b
3 changed files with 7 additions and 7 deletions
@@ -21,7 +21,7 @@ function sqlInsertGenerator({ tableName, data, dbFullName, }) {
let queryValues = [];
data.forEach((item) => {
queryBatches.push(`(${insertKeys
.map((ky) => {
.map((ky, indx) => {
const value = item[ky];
const finalValue = typeof value == "string" ||
typeof value == "number"
@@ -30,8 +30,8 @@ function sqlInsertGenerator({ tableName, data, dbFullName, }) {
? String(value().value)
: null;
if (!finalValue) {
queryValues.push("");
return "?";
insertKeys.splice(indx, 1);
return;
}
queryValues.push(finalValue);
const placeholder = typeof value == "function"