mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -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',
|
||||
icon: 'file:mysql.svg',
|
||||
group: ['input'],
|
||||
defaultVersion: 2,
|
||||
defaultVersion: 2.1,
|
||||
description: 'Get, add and update data in MySQL',
|
||||
};
|
||||
|
||||
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
||||
1: new MySqlV1(baseDescription),
|
||||
2: new MySqlV2(baseDescription),
|
||||
2.1: new MySqlV2(baseDescription),
|
||||
};
|
||||
|
||||
super(nodeVersions, baseDescription);
|
||||
|
|
|
@ -19,6 +19,8 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
|||
const operation = this.getNodeParameter('operation', 0);
|
||||
const nodeOptions = this.getNodeParameter('options', 0);
|
||||
|
||||
nodeOptions.nodeVersion = this.getNode().typeVersion;
|
||||
|
||||
const credentials = await this.getCredentials('mySql');
|
||||
|
||||
let sshClient: Client | undefined = undefined;
|
||||
|
|
|
@ -8,7 +8,7 @@ export const versionDescription: INodeTypeDescription = {
|
|||
name: 'mySql',
|
||||
icon: 'file:mysql.svg',
|
||||
group: ['input'],
|
||||
version: 2,
|
||||
version: [2, 2.1],
|
||||
subtitle: '={{ $parameter["operation"] }}',
|
||||
description: 'Get, add and update data in MySQL',
|
||||
defaults: {
|
||||
|
|
|
@ -78,6 +78,10 @@ export async function createPool(
|
|||
supportBigNumbers: true,
|
||||
};
|
||||
|
||||
if (options?.nodeVersion && (options.nodeVersion as number) >= 2.1) {
|
||||
connectionOptions.dateStrings = true;
|
||||
}
|
||||
|
||||
if (options?.connectionLimit) {
|
||||
connectionOptions.connectionLimit = options.connectionLimit as number;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue