nodejs-datastore icon indicating copy to clipboard operation
nodejs-datastore copied to clipboard

Add warning when inference used for Number types to Datastore types

Open crwilcox opened this issue 4 years ago • 2 comments

As discussed in #754, the auto conversion to datastore types doesn't work particualrly well in Node.js. Numbers need to be coverted to int, double, but there are times it makes the wrong choice.

This functionality is planned to be removed in a future version as it is too easy for customers to do the wrong thing and end up with disparate types unexpectedly.

Example Insert "3.0", "3.99", "4.99" expecting double, double, double. Actual is int, double, double, as 3.0 is an integer.

This issue tracks adding a warning in a fix release letting customers know that inference is being used and can be fragile, particularly if used for columns expected to be floats/doubles.

crwilcox avatar Nov 18 '20 21:11 crwilcox

I think we are going to decide to not warn, but just remove this functionality as stated in #760.

crwilcox avatar Dec 04 '20 23:12 crwilcox

Warning is less breaking to users than deprecation, and customers that use ints only will not experience the degraded experience. This warning is a smaller step and directs users to the source of inconsistent types in their node code.

crwilcox avatar Dec 09 '20 18:12 crwilcox