|
|
@ -5332,14 +5332,11 @@ class BaseModelSqlv2 { |
|
|
|
const dataWithoutPks = []; |
|
|
|
const dataWithoutPks = []; |
|
|
|
|
|
|
|
|
|
|
|
for (const data of preparedDatas) { |
|
|
|
for (const data of preparedDatas) { |
|
|
|
if (!raw) { |
|
|
|
|
|
|
|
await this.prepareNocoData(data, true, cookie); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const pkValues = this.extractPksValues(data); |
|
|
|
const pkValues = this.extractPksValues(data); |
|
|
|
if (pkValues !== 'N/A' && pkValues !== undefined) { |
|
|
|
if (pkValues !== 'N/A' && pkValues !== undefined) { |
|
|
|
dataWithPks.push({ pk: pkValues, data }); |
|
|
|
dataWithPks.push({ pk: pkValues, data }); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
await this.prepareNocoData(data, true, cookie) |
|
|
|
// const insertObj = this.handleValidateBulkInsert(data, columns);
|
|
|
|
// const insertObj = this.handleValidateBulkInsert(data, columns);
|
|
|
|
dataWithoutPks.push(data); |
|
|
|
dataWithoutPks.push(data); |
|
|
|
} |
|
|
|
} |
|
|
@ -5359,8 +5356,10 @@ class BaseModelSqlv2 { |
|
|
|
|
|
|
|
|
|
|
|
for (const { pk, data } of dataWithPks) { |
|
|
|
for (const { pk, data } of dataWithPks) { |
|
|
|
if (existingPkSet.has(pk)) { |
|
|
|
if (existingPkSet.has(pk)) { |
|
|
|
|
|
|
|
await this.prepareNocoData(data, false, cookie) |
|
|
|
toUpdate.push(data); |
|
|
|
toUpdate.push(data); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
await this.prepareNocoData(data, true, cookie) |
|
|
|
// const insertObj = this.handleValidateBulkInsert(data, columns);
|
|
|
|
// const insertObj = this.handleValidateBulkInsert(data, columns);
|
|
|
|
toInsert.push(data); |
|
|
|
toInsert.push(data); |
|
|
|
} |
|
|
|
} |
|
|
|