IzumiSy / elm-firestore

*Experimental* A type-safe Firestore integration for Elm
https://package.elm-lang.org/packages/IzumiSy/elm-firestore/latest/
MIT License
14 stars 2 forks source link

Support 64-bit integer values #36

Open DavidDTA opened 2 years ago

DavidDTA commented 2 years ago

The current code will only support 52-bit integers because that is the size of the elm Int type. However, the data format for firestore supports 64-bit integers, and we should preserve the serialized values.

This can be done using folkertdev/elm-int64 or malaire/elm-uint64.

IzumiSy commented 2 years ago

Thanks for your info! (but why have you closed this issue?)

DavidDTA commented 2 years ago

I found myself confused by the firebase documentation, and I wasn't actually sure whether it supports 64-bit integers. It says it does, but if its interchange format is JSON, I don't think it really can.

DavidDTA commented 2 years ago

Okay, I now see that int64 values are represented as strings under the hood.

It looks like this library could be expanded to allow decoding of more firestore types since right now it can not decode everything that could be stored. I don't have a use case for this right now, but I could open another issue if you would like me to.