feat(MySQL Node): Return decimal types as numbers (#10313)

This commit is contained in:
Ria Scholz 2024-08-07 12:48:14 +02:00 committed by GitHub
parent bf8f848645
commit f744d7c100
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View file

@ -134,6 +134,16 @@ export const optionsCollection: INodeProperties = {
show: { '/operation': ['select', 'executeQuery'] },
},
},
{
displayName: 'Output Decimals as Numbers',
name: 'decimalNumbers',
type: 'boolean',
default: false,
description: 'Whether to output DECIMAL types as numbers instead of strings',
displayOptions: {
show: { '/operation': ['select', 'executeQuery'] },
},
},
{
displayName: 'Priority',
name: 'priority',

View file

@ -24,6 +24,7 @@ export async function createPool(
password: credentials.password,
multipleStatements: true,
supportBigNumbers: true,
decimalNumbers: false,
};
if (credentials.ssl) {
@ -55,6 +56,10 @@ export async function createPool(
connectionOptions.bigNumberStrings = true;
}
if (options?.decimalNumbers === true) {
connectionOptions.decimalNumbers = true;
}
if (!credentials.sshTunnel) {
return mysql2.createPool(connectionOptions);
} else {