nodejs-datastore
nodejs-datastore copied to clipboard
Don't unwrap automatically for Number to Datastore Types
Related to #754, #759
Remove auto inference of Numbers. This is a 'foot-gun' in the library and we should encourage usage of datastore.double
and datastore.int
so the library doesn't choose poorly.
This is for sure used in Save and Query today.
Note: breaking change.
It would be nice to create a migration path for DB created before inference is removed.
In such DB there could be a mix of integer/float for the same property and datastore.double
/ datastore.int
would only apply to numbers created after the inference is removed.
Going to block on this happening for a bit. Warning may be enough and is in PR, tracked by 759.
I am rewording this as the approach has moved from removal to changing the default behavior. By default we shouldn't unwrap these. Int and Double , as of the pr (773) extend Number. Keeping them wrapped should cause no/minimal friction, but allow us to still have additional data about the type in datastore.
Reconsider the approach (back to removal) — added thenext major: breaking change
label to ensure we don't miss it.