feat(Data Table Node): Add Update, Upsert operations (no-changelog) (#18820)

This commit is contained in:
Charlie Kolb
2025-08-28 13:20:29 +02:00
committed by GitHub
parent 0347c32cd5
commit 1b743ae251
12 changed files with 241 additions and 59 deletions

View File

@@ -11,7 +11,10 @@ import type { FilterType } from './constants';
import { DATA_TABLE_ID_FIELD } from './fields';
import { buildGetManyFilter, isFieldArray, isMatchType } from './utils';
export function getSelectFields(displayOptions: IDisplayOptions): INodeProperties[] {
export function getSelectFields(
displayOptions: IDisplayOptions,
requireCondition = false,
): INodeProperties[] {
return [
{
displayName: 'Must Match',
@@ -36,6 +39,7 @@ export function getSelectFields(displayOptions: IDisplayOptions): INodePropertie
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
minRequiredFields: requireCondition ? 1 : 0,
},
displayOptions,
default: {},
@@ -105,9 +109,14 @@ export async function executeSelectMany(
ctx: IExecuteFunctions,
index: number,
dataStoreProxy: IDataStoreProjectService,
rejectEmpty = false,
): Promise<Array<{ json: DataStoreRowReturn }>> {
const filter = getSelectFilter(ctx, index);
if (rejectEmpty && filter.filters.length === 0) {
throw new NodeOperationError(ctx.getNode(), 'At least one condition is required');
}
let take = 1000;
const result: Array<{ json: DataStoreRowReturn }> = [];
let totalCount = undefined;