Browse Source

feat: add composite support in baseModel ee version - bulkinsert with nested data

pull/7649/head
Pranav C 9 months ago
parent
commit
7898d68790
  1. 10
      packages/nocodb/src/db/BaseModelSqlv2.ts

10
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -2924,7 +2924,7 @@ class BaseModelSqlv2 {
return rowId;
}
private async prepareNestedLinkQb({
protected async prepareNestedLinkQb({
nestedCols,
data,
insertObj,
@ -3243,17 +3243,17 @@ class BaseModelSqlv2 {
);
}
} else {
const returningObj: Record<string, string> = {};
const returningArr: string[] = [];
for (const col of this.model.primaryKeys) {
returningObj[col.title] = col.column_name;
returningArr.push(col.column_name);
}
responses =
!raw && (this.isPg || this.isMssql)
? await trx
.batchInsert(this.tnPath, insertDatas, chunkSize)
.returning(returningObj)
.returning(this.model.primaryKeys?.length ? returningArr : '*')
: await trx.batchInsert(this.tnPath, insertDatas, chunkSize);
}
@ -4025,7 +4025,7 @@ class BaseModelSqlv2 {
}
// method for validating otpions if column is single/multi select
private async validateOptions(
protected async validateOptions(
column: Column<any>,
insertOrUpdateObject: Record<string, any>,
) {

Loading…
Cancel
Save