Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/nodes-base/nodes/MySql/v2/actions/common.descriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 5 additions & 0 deletions packages/nodes-base/nodes/MySql/v2/transport/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export async function createPool(
password: credentials.password,
multipleStatements: true,
supportBigNumbers: true,
decimalNumbers: false,
};

if (credentials.ssl) {
Expand Down Expand Up @@ -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 {
Expand Down
Loading