nodejs-datastore
nodejs-datastore copied to clipboard
Add warning when inference used for Number types to Datastore types
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.
I think we are going to decide to not warn, but just remove this functionality as stated in #760.
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.