mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(MySQL Node): Node should return date types as strings (#6169)
This commit is contained in:
parent
3074f42b3b
commit
5d77ec76e3
|
@ -11,13 +11,14 @@ export class MySql extends VersionedNodeType {
|
||||||
name: 'mySql',
|
name: 'mySql',
|
||||||
icon: 'file:mysql.svg',
|
icon: 'file:mysql.svg',
|
||||||
group: ['input'],
|
group: ['input'],
|
||||||
defaultVersion: 2,
|
defaultVersion: 2.1,
|
||||||
description: 'Get, add and update data in MySQL',
|
description: 'Get, add and update data in MySQL',
|
||||||
};
|
};
|
||||||
|
|
||||||
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
||||||
1: new MySqlV1(baseDescription),
|
1: new MySqlV1(baseDescription),
|
||||||
2: new MySqlV2(baseDescription),
|
2: new MySqlV2(baseDescription),
|
||||||
|
2.1: new MySqlV2(baseDescription),
|
||||||
};
|
};
|
||||||
|
|
||||||
super(nodeVersions, baseDescription);
|
super(nodeVersions, baseDescription);
|
||||||
|
|
|
@ -19,6 +19,8 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
||||||
const operation = this.getNodeParameter('operation', 0);
|
const operation = this.getNodeParameter('operation', 0);
|
||||||
const nodeOptions = this.getNodeParameter('options', 0);
|
const nodeOptions = this.getNodeParameter('options', 0);
|
||||||
|
|
||||||
|
nodeOptions.nodeVersion = this.getNode().typeVersion;
|
||||||
|
|
||||||
const credentials = await this.getCredentials('mySql');
|
const credentials = await this.getCredentials('mySql');
|
||||||
|
|
||||||
let sshClient: Client | undefined = undefined;
|
let sshClient: Client | undefined = undefined;
|
||||||
|
|
|
@ -8,7 +8,7 @@ export const versionDescription: INodeTypeDescription = {
|
||||||
name: 'mySql',
|
name: 'mySql',
|
||||||
icon: 'file:mysql.svg',
|
icon: 'file:mysql.svg',
|
||||||
group: ['input'],
|
group: ['input'],
|
||||||
version: 2,
|
version: [2, 2.1],
|
||||||
subtitle: '={{ $parameter["operation"] }}',
|
subtitle: '={{ $parameter["operation"] }}',
|
||||||
description: 'Get, add and update data in MySQL',
|
description: 'Get, add and update data in MySQL',
|
||||||
defaults: {
|
defaults: {
|
||||||
|
|
|
@ -78,6 +78,10 @@ export async function createPool(
|
||||||
supportBigNumbers: true,
|
supportBigNumbers: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (options?.nodeVersion && (options.nodeVersion as number) >= 2.1) {
|
||||||
|
connectionOptions.dateStrings = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (options?.connectionLimit) {
|
if (options?.connectionLimit) {
|
||||||
connectionOptions.connectionLimit = options.connectionLimit as number;
|
connectionOptions.connectionLimit = options.connectionLimit as number;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue