This commit is contained in:
Benjamin Toby 2026-02-11 07:38:59 +01:00
parent fd83f6ab1b
commit af2749a922
3 changed files with 7 additions and 7 deletions

View File

@ -21,7 +21,7 @@ function sqlInsertGenerator({ tableName, data, dbFullName, }) {
let queryValues = [];
data.forEach((item) => {
queryBatches.push(`(${insertKeys
.map((ky, indx) => {
.map((ky) => {
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) {
insertKeys.splice(indx, 1);
return;
queryValues.push("");
return "?";
}
queryValues.push(finalValue);
const placeholder = typeof value == "function"

View File

@ -29,7 +29,7 @@ export default function sqlInsertGenerator({
data.forEach((item) => {
queryBatches.push(
`(${insertKeys
.map((ky, indx) => {
.map((ky) => {
const value = item[ky];
const finalValue =
@ -41,8 +41,8 @@ export default function sqlInsertGenerator({
: null;
if (!finalValue) {
insertKeys.splice(indx, 1);
return;
queryValues.push("");
return "?";
}
queryValues.push(finalValue);

View File

@ -1,6 +1,6 @@
{
"name": "@moduletrace/datasquirel",
"version": "5.7.44",
"version": "5.7.45",
"description": "Cloud-based SQL data management tool",
"main": "dist/index.js",
"bin": {