mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-23 10:32:17 -08:00
feat(MySQL Node): Return decimal types as numbers (#10313)
This commit is contained in:
parent
bf8f848645
commit
f744d7c100
|
@ -134,6 +134,16 @@ export const optionsCollection: INodeProperties = {
|
||||||
show: { '/operation': ['select', 'executeQuery'] },
|
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',
|
displayName: 'Priority',
|
||||||
name: 'priority',
|
name: 'priority',
|
||||||
|
|
|
@ -24,6 +24,7 @@ export async function createPool(
|
||||||
password: credentials.password,
|
password: credentials.password,
|
||||||
multipleStatements: true,
|
multipleStatements: true,
|
||||||
supportBigNumbers: true,
|
supportBigNumbers: true,
|
||||||
|
decimalNumbers: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (credentials.ssl) {
|
if (credentials.ssl) {
|
||||||
|
@ -55,6 +56,10 @@ export async function createPool(
|
||||||
connectionOptions.bigNumberStrings = true;
|
connectionOptions.bigNumberStrings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options?.decimalNumbers === true) {
|
||||||
|
connectionOptions.decimalNumbers = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!credentials.sshTunnel) {
|
if (!credentials.sshTunnel) {
|
||||||
return mysql2.createPool(connectionOptions);
|
return mysql2.createPool(connectionOptions);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue