mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat(MySQL Node): Hints for executeQuery and select operations (#16753)
This commit is contained in:
@@ -70,7 +70,7 @@ export const optionsCollection: INodeProperties = {
|
||||
description: 'A single query for all incoming items',
|
||||
},
|
||||
{
|
||||
name: 'Independently',
|
||||
name: 'Independent',
|
||||
value: BATCH_MODE.INDEPENDENTLY,
|
||||
description: 'Execute one query per incoming item of the run',
|
||||
},
|
||||
|
||||
@@ -3,6 +3,7 @@ import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import * as database from './database/Database.resource';
|
||||
import type { MySqlType } from './node.type';
|
||||
import { addExecutionHints } from '../../../../utils/utilities';
|
||||
import type { MysqlNodeCredentials, QueryRunner } from '../helpers/interfaces';
|
||||
import { configureQueryRunner } from '../helpers/utils';
|
||||
import { createPool } from '../transport';
|
||||
@@ -10,11 +11,13 @@ import { createPool } from '../transport';
|
||||
export async function router(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
let returnData: INodeExecutionData[] = [];
|
||||
|
||||
const items = this.getInputData();
|
||||
const resource = this.getNodeParameter<MySqlType>('resource', 0);
|
||||
const operation = this.getNodeParameter('operation', 0);
|
||||
const nodeOptions = this.getNodeParameter('options', 0);
|
||||
const node = this.getNode();
|
||||
|
||||
nodeOptions.nodeVersion = this.getNode().typeVersion;
|
||||
nodeOptions.nodeVersion = node.typeVersion;
|
||||
|
||||
const credentials = await this.getCredentials<MysqlNodeCredentials>('mySql');
|
||||
|
||||
@@ -30,8 +33,6 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
||||
try {
|
||||
switch (mysqlNodeData.resource) {
|
||||
case 'database':
|
||||
const items = this.getInputData();
|
||||
|
||||
returnData = await database[mysqlNodeData.operation].execute.call(
|
||||
this,
|
||||
items,
|
||||
@@ -49,5 +50,7 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
||||
await pool.end();
|
||||
}
|
||||
|
||||
addExecutionHints(this, node, items, operation, node.executeOnce);
|
||||
|
||||
return [returnData];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user