mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 20:00:02 +00:00
fix(Data Table Node): Add bulk insert option (no-changelog) (#19176)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type {
|
||||
IDataStoreProjectService,
|
||||
IDisplayOptions,
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
@@ -30,3 +31,13 @@ export async function execute(
|
||||
const insertedRows = await dataStoreProxy.insertRows([row]);
|
||||
return insertedRows.map((json) => ({ json }));
|
||||
}
|
||||
|
||||
export async function executeBulk(
|
||||
this: IExecuteFunctions,
|
||||
proxy: IDataStoreProjectService,
|
||||
): Promise<INodeExecutionData[]> {
|
||||
const rows = this.getInputData().flatMap((_, i) => [getAddRow(this, i)]);
|
||||
|
||||
const insertedRows = await proxy.insertRows(rows);
|
||||
return insertedRows.map((json, item) => ({ json, pairedItem: { item } }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user