mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(core): Node hints improvements (no-changelog) (#9387)
Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import { NodeExecutionOutput, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { configurePostgres } from '../transport';
|
||||
import { configureQueryRunner } from '../helpers/utils';
|
||||
@@ -17,7 +17,8 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
||||
|
||||
const credentials = (await this.getCredentials('postgres')) as PostgresNodeCredentials;
|
||||
const options = this.getNodeParameter('options', 0, {}) as PostgresNodeOptions;
|
||||
options.nodeVersion = this.getNode().typeVersion;
|
||||
const node = this.getNode();
|
||||
options.nodeVersion = node.typeVersion;
|
||||
options.operation = operation;
|
||||
|
||||
const { db, pgp, sshClient } = await configurePostgres(credentials, options);
|
||||
@@ -62,5 +63,17 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
||||
if (!db.$pool.ending) await db.$pool.end();
|
||||
}
|
||||
|
||||
if (operation === 'select' && items.length > 1 && !node.executeOnce) {
|
||||
return new NodeExecutionOutput(
|
||||
[returnData],
|
||||
[
|
||||
{
|
||||
message: `This node ran ${items.length} times, once for each input item. To run for the first item only, enable 'execute once' in the node settings`,
|
||||
location: 'outputPane',
|
||||
},
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return [returnData];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user