mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -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'] },
|
||||
},
|
||||
},
|
||||
{
|
||||
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',
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue