mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Data Table Node): Add Delete operation (no-changelog) (#18785)
This commit is contained in:
@@ -5,7 +5,7 @@ import type {
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { getSelectFields, getSelectFilter } from '../../common/selectMany';
|
||||
import { executeSelectMany, getSelectFields } from '../../common/selectMany';
|
||||
import { getDataTableProxyExecute } from '../../common/utils';
|
||||
|
||||
export const FIELD: string = 'get';
|
||||
@@ -25,26 +25,5 @@ export async function execute(
|
||||
): Promise<INodeExecutionData[]> {
|
||||
const dataStoreProxy = await getDataTableProxyExecute(this, index);
|
||||
|
||||
let take = 1000;
|
||||
const result: INodeExecutionData[] = [];
|
||||
|
||||
const filter = getSelectFilter(this, index);
|
||||
|
||||
do {
|
||||
const response = await dataStoreProxy.getManyRowsAndCount({
|
||||
skip: result.length,
|
||||
take,
|
||||
filter,
|
||||
});
|
||||
const data = response.data.map((json) => ({ json }));
|
||||
|
||||
// Optimize common path of <1000 results
|
||||
if (response.count === response.data.length) {
|
||||
return data;
|
||||
}
|
||||
|
||||
result.push.apply(result, data);
|
||||
take = Math.min(take, response.count - result.length);
|
||||
} while (take > 0);
|
||||
return result;
|
||||
return await executeSelectMany(this, index, dataStoreProxy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user