mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 03:16:01 +00:00
fix(cassandra): use put raw for numeric data types
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
const { SqlDumper } = global.DBGATE_PACKAGES['dbgate-tools'];
|
||||
|
||||
const numericDataTypes = ['tinyint', 'smallint', 'int', 'bigint', 'varint', 'float', 'double', 'decimal'];
|
||||
|
||||
class Dumper extends SqlDumper {
|
||||
/**
|
||||
* @param {import('dbgate-types').ColumnInfo} column
|
||||
@@ -61,6 +63,11 @@ class Dumper extends SqlDumper {
|
||||
return;
|
||||
}
|
||||
|
||||
if (numericDataTypes.includes(dataType?.toLowerCase()) && !Number.isNaN(parseFloat(value))) {
|
||||
this.putRaw(value);
|
||||
return;
|
||||
}
|
||||
|
||||
super.putValue(value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user