Fork me on GitHub
#datomic
<
2020-10-16
>
roninhacker16:10:30

We're running with datomic on the backend and datascript on the front end. I'd like to just mirror datomic ids on the client side, but datascript uses longs for its ids, which means some datomic ids don't fit. Are there datomic settings that can constrain the id space? (if not I'll just write some transformation glue on the FE)

favila18:10:56

Datomic also uses longs....

favila18:10:02

Do you mean doubles? Are you worried about the 52 bit integer representation limit?

roninhacker22:10:28

ah, yes, I guess it's not strictly datatype I'm worried about, but datascript's id limit of 2147483647

roninhacker22:10:04

(which seems to be 2^31 -1 )

favila23:10:30

D/tx->t will give you a 42 bit unique id per entity, which is extremely likely to be < 32 bits u less you have a huge number of entities or transactions. Maybe that’s useful info for some clever encoding scheme

roninhacker23:10:40

hmmm, thank you