Updates
This commit is contained in:
parent
fd83f6ab1b
commit
af2749a922
@ -21,7 +21,7 @@ function sqlInsertGenerator({ tableName, data, dbFullName, }) {
|
|||||||
let queryValues = [];
|
let queryValues = [];
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
queryBatches.push(`(${insertKeys
|
queryBatches.push(`(${insertKeys
|
||||||
.map((ky, indx) => {
|
.map((ky) => {
|
||||||
const value = item[ky];
|
const value = item[ky];
|
||||||
const finalValue = typeof value == "string" ||
|
const finalValue = typeof value == "string" ||
|
||||||
typeof value == "number"
|
typeof value == "number"
|
||||||
@ -30,8 +30,8 @@ function sqlInsertGenerator({ tableName, data, dbFullName, }) {
|
|||||||
? String(value().value)
|
? String(value().value)
|
||||||
: null;
|
: null;
|
||||||
if (!finalValue) {
|
if (!finalValue) {
|
||||||
insertKeys.splice(indx, 1);
|
queryValues.push("");
|
||||||
return;
|
return "?";
|
||||||
}
|
}
|
||||||
queryValues.push(finalValue);
|
queryValues.push(finalValue);
|
||||||
const placeholder = typeof value == "function"
|
const placeholder = typeof value == "function"
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export default function sqlInsertGenerator({
|
|||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
queryBatches.push(
|
queryBatches.push(
|
||||||
`(${insertKeys
|
`(${insertKeys
|
||||||
.map((ky, indx) => {
|
.map((ky) => {
|
||||||
const value = item[ky];
|
const value = item[ky];
|
||||||
|
|
||||||
const finalValue =
|
const finalValue =
|
||||||
@ -41,8 +41,8 @@ export default function sqlInsertGenerator({
|
|||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (!finalValue) {
|
if (!finalValue) {
|
||||||
insertKeys.splice(indx, 1);
|
queryValues.push("");
|
||||||
return;
|
return "?";
|
||||||
}
|
}
|
||||||
|
|
||||||
queryValues.push(finalValue);
|
queryValues.push(finalValue);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/datasquirel",
|
"name": "@moduletrace/datasquirel",
|
||||||
"version": "5.7.44",
|
"version": "5.7.45",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user