fix(MySQL Node): Node should return date types as strings (#6169)

This commit is contained in:
Michael Kret 2023-05-03 18:45:21 +03:00 committed by GitHub
parent 3074f42b3b
commit 5d77ec76e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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: {

View file

@ -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;
}