Skip to content

Commit c701599

Browse files
committed
add value transformators
1 parent 68ec74c commit c701599

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

packages/cubejs-mssql-driver/src/MSSqlDriver.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,22 @@ import {
2121
import { QueryStream } from './QueryStream';
2222

2323
// ********* Value converters ***************** //
24-
// sql.valueHandler.set(sql.TYPES.Int, (value) => value + 1);
24+
const numericTypes = [
25+
sql.TYPES.Int,
26+
sql.TYPES.BigInt,
27+
sql.TYPES.SmallInt,
28+
sql.TYPES.TinyInt,
29+
sql.TYPES.Decimal,
30+
sql.TYPES.Numeric,
31+
sql.TYPES.Float,
32+
sql.TYPES.Real,
33+
sql.TYPES.Money,
34+
sql.TYPES.SmallMoney
35+
];
36+
37+
for (const type of numericTypes) {
38+
sql.valueHandler.set(type, (value) => value != null ? String(value) : value);
39+
}
2540

2641
export type MSSqlDriverConfiguration = Omit<MsSQLConfig, 'server'> & {
2742
readOnly?: boolean;

0 commit comments

Comments
 (0)