mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(MySQL Node): Resolve expressions in v1 (#7464)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -18,6 +18,7 @@ import type mysql2 from 'mysql2/promise';
|
||||
import { createConnection, searchTables } from './GenericFunctions';
|
||||
|
||||
import { oldVersionNotice } from '@utils/descriptions';
|
||||
import { getResolvables } from '@utils/utilities';
|
||||
|
||||
const versionDescription: INodeTypeDescription = {
|
||||
displayName: 'MySQL',
|
||||
@@ -306,8 +307,15 @@ export class MySqlV1 implements INodeType {
|
||||
// ----------------------------------
|
||||
|
||||
try {
|
||||
const queryQueue = items.map(async (item, index) => {
|
||||
const rawQuery = this.getNodeParameter('query', index) as string;
|
||||
const queryQueue = items.map(async (_, index) => {
|
||||
let rawQuery = (this.getNodeParameter('query', index) as string).trim();
|
||||
|
||||
for (const resolvable of getResolvables(rawQuery)) {
|
||||
rawQuery = rawQuery.replace(
|
||||
resolvable,
|
||||
this.evaluateExpression(resolvable, index) as string,
|
||||
);
|
||||
}
|
||||
|
||||
return connection.query(rawQuery);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user