fix(cassandra): use put raw for numeric data types

This commit is contained in:
Nybkox
2025-02-06 10:09:19 +01:00
parent 505c219cfd
commit 0f01f35d19

View File

@@ -3,6 +3,8 @@
*/ */
const { SqlDumper } = global.DBGATE_PACKAGES['dbgate-tools']; const { SqlDumper } = global.DBGATE_PACKAGES['dbgate-tools'];
const numericDataTypes = ['tinyint', 'smallint', 'int', 'bigint', 'varint', 'float', 'double', 'decimal'];
class Dumper extends SqlDumper { class Dumper extends SqlDumper {
/** /**
* @param {import('dbgate-types').ColumnInfo} column * @param {import('dbgate-types').ColumnInfo} column
@@ -61,6 +63,11 @@ class Dumper extends SqlDumper {
return; return;
} }
if (numericDataTypes.includes(dataType?.toLowerCase()) && !Number.isNaN(parseFloat(value))) {
this.putRaw(value);
return;
}
super.putValue(value); super.putValue(value);
} }
} }