mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 13:23:58 +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 { 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user