|
|
@ -66,13 +66,19 @@ export default class NcConnectionMgrv2 { |
|
|
|
connection: { |
|
|
|
connection: { |
|
|
|
...defaultConnectionConfig, |
|
|
|
...defaultConnectionConfig, |
|
|
|
...connectionConfig.connection, |
|
|
|
...connectionConfig.connection, |
|
|
|
typeCast(_field, next) { |
|
|
|
typeCast(field, next) { |
|
|
|
const res = next(); |
|
|
|
const res = next(); |
|
|
|
if (res instanceof Buffer) { |
|
|
|
if (res instanceof Buffer) { |
|
|
|
return [...res] |
|
|
|
return [...res] |
|
|
|
.map((v) => ('00' + v.toString(16)).slice(-2)) |
|
|
|
.map((v) => ('00' + v.toString(16)).slice(-2)) |
|
|
|
.join(''); |
|
|
|
.join(''); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// mysql `decimal` datatype returns value as string, convert it to float number
|
|
|
|
|
|
|
|
if (field.type == 'NEWDECIMAL') { |
|
|
|
|
|
|
|
return res && parseFloat(res); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return res; |
|
|
|
return res; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|