CraZySacX / node-jdbc

JDBC Wrapper for node.js
140 stars 107 forks source link

Wrong conversion for BigDecimal types #213

Closed ishtartec closed 3 years ago

ishtartec commented 3 years ago

Hi!

https://github.com/CraZySacX/node-jdbc/blob/a9dd8efd96482d0f6ad788ce70ac18d0d9890b13/lib/resultset.js#L126

This line is breaking the behavior of queries. It is returning only the integer part, removing the decimals: if(type === 'BigDecimal') type = 'Int';

I guess it should be changed to something like: if(type === 'BigDecimal') type = 'Double';

I have tested this change and sets the expected and correct behavior.

CraZySacX commented 3 years ago

Fixed with the latest release (0.7.4). Also added a test to ensure that decimals are preserved.