Browse Source

feat: if array of values passed then do bulk insert

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5901/head
Pranav C 1 year ago
parent
commit
0d9c896ab6
  1. 7
      packages/nocodb/src/services/data-table.service.ts

7
packages/nocodb/src/services/data-table.service.ts

@ -65,7 +65,12 @@ export class DataTableService {
dbDriver: await NcConnectionMgrv2.get(base),
});
return await baseModel.insert(param.body, null, param.cookie);
// if array then do bulk insert
if (Array.isArray(param.body)) {
return await baseModel.bulkInsert(param.body, { cookie: param.cookie });
} else {
return await baseModel.insert(param.body, null, param.cookie);
}
}
async dataUpdate(param: {

Loading…
Cancel
Save