dgraph-io / dgraph

The high-performance database for modern applications
https://dgraph.io
Other
20.43k stars 1.5k forks source link

Support arbitrary-precision numeric types #2107

Closed malzzz closed 4 years ago

malzzz commented 6 years ago

My use-case for dgraph deals almost exclusively with 256-bit uints. Are there any plans for bignum datatypes at any point in the future? If not, is there possibly a way to implement that myself as a plugin? There are some workarounds I can use, like storing raw representations as strings, but none of those are ideal, since they'd limit the range of possible queries. Thanks!

pawanrawal commented 6 years ago

We may support them later but it's not a priority right now since there isn't enough demand for it. Adding support is non-trivial since Go doesn't support these types natively.

srfrog commented 5 years ago

Related: #926

manishrjain commented 5 years ago

We can switch our implementations to this. Or, introduce a new type for arbitrary-precision numeric types:

https://golang.org/pkg/math/big/

minhaj-shakeel commented 4 years ago

Github issues have been deprecated. This issue has been moved to discuss. You can follow the conversation there and also subscribe to updates by changing your notification preferences.

drawing
CaelumF commented 3 years ago

I'm surprised there isn't demand for it. It is essential for anything related to money or crypto. One lovely thing about dgraph is that I can use the very same Kotlin classes that my backend uses with graphql-kotlin after they're converted to GraphQL automatically for persistence, runtime and the frontend! But because dgraph doesn't support BigDecimal I'd have to change the frontend and backend to work with some seriously unsavoury alternatives (made worse by the large difference in value between currencies) :(

aranwe commented 3 years ago

Yeah, I would love to see this in Dgraph too. Any chance of reopening/revisiting this? I can imagine that this brings a lot of complexity. :)

sanudatta11 commented 2 years ago

Hello, Any update on having this integrated? This will be a serious boost in our decision to use DGraph in our upcoming financial services