@whilo if I import datoms that were exported to cbor, will my history be preserved?
I need to go sort out some family stuff. I'll pop and example on a bit later.
This is an open issue it seems: https://github.com/replikativ/datahike/issues/633
Oh, right. Thanks for pulling it out.
@hoertlehner also provided a workaround there.
The history should be exported https://github.com/replikativ/datahike/blob/main/src/datahike/migrate.clj#L16
But I haven't used this code lately, I am not sure whether the history is also correctly imported.
Are you having problems with that?
We shall soon find out. Wanted to ask before I try
Yeah it didn't work ðŸ˜
Bad entity value 0.0 at [:db/add 487 :expense/salestaxamount 0.0 536870922], value does not match schema definition. Must be conform to: double?0.0 is not deemed to be a double
Can you just copy the import code and add a case to https://github.com/replikativ/datahike/blob/main/src/datahike/migrate.clj#L27 to also convert to double?
@yeefay.lim wrote this code some time ago. It would be helpful to know a bit more context.
@alekcz360 can you also explain briefly what your current requirements are?
I moved to Google Cloud because http://render.com didn't have ISO certification. They have now achieved the certification. So I'm migrating back.
I've backed up my beta environment and I'm testing the migration on 400k datoms. If all goes well I will migrate the 3M datoms
The data is accounting data so there are lots of different types. int, double, longs, dates, and strings.
Different types should be fine, I guess CBOR saved the data as float and not double for some reason. Did you explicitly store floats?
Nope. In my schema they are doubles.
Then the export code is broken.
The problem is actually in Clojure. float? is true also for doubles.
Which makes CBOR export it as a float.
No, wait.
So doubles seem to roundtrip ok through clj-cbor.
Hmm, weird, I cannot reproduce that a double attribute in the schema turns into a float on import. If you have a small example to reproduce that would help.