fix(Postgres Node): Remove reusable connections (no-changelog) (#6259)

This commit is contained in:
Michael Kret
2023-05-19 16:42:24 +03:00
committed by GitHub
parent 4b5cbe7750
commit be5d3264ad
7 changed files with 64 additions and 61 deletions

View File

@@ -1,5 +1,6 @@
import type { IExecuteFunctions } from 'n8n-core';
import type { IDataObject, INodeExecutionData, INodeProperties } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
@@ -181,6 +182,13 @@ export async function execute(
valueToMatchOn = this.getNodeParameter('valueToMatchOn', i) as string;
}
if (!item[columnToMatchOn] && dataMode === 'autoMapInputData') {
throw new NodeOperationError(
this.getNode(),
"Column to match on not found in input item. Add a column to match on or set the 'Data Mode' to 'Define Below' to define the value to match on.",
);
}
const tableSchema = await getTableSchema(db, schema, table);
item = checkItemAgainstSchema(this.getNode(), item, tableSchema, i);
@@ -195,6 +203,13 @@ export async function execute(
const updateColumns = Object.keys(item).filter((column) => column !== columnToMatchOn);
if (!Object.keys(updateColumns).length) {
throw new NodeOperationError(
this.getNode(),
"Add values to update to the input item or set the 'Data Mode' to 'Define Below' to define the values to update.",
);
}
const updates: string[] = [];
for (const column of updateColumns) {