datahike

2025-09-29T15:44:41.907259Z

Hi I have started playing with datathike and I have a strange issue. When transacting a schema for a tuple, the order in which I declare the keys can generate an exception. Here is little snippet to explain myself better:

whilo 2025-09-30T08:23:30.398019Z

Hey @jeremys. What is the exception being thrown?

2025-09-30T10:15:59.607689Z

2025-09-30T11:05:37.832599Z

I don't know what to think of it, it's like the layout of the data in the underlying array map influences the outcome. At least that all I an think of...

whilo 2025-09-30T15:16:53.877709Z

yes it does, interesting. my guess is that the schema is updated in an order where the prior schema key-value pairs are missing and that is how it trips (although i am not sure why it yields a long yet). can you open a bug report? i guess we will have to ensure a specific ordering for schema maps that are transacted

2025-09-30T15:18:46.292569Z

I can, I'll add the example to the issue.

👍 1
2025-09-30T15:33:58.330829Z

I created an https://github.com/replikativ/datahike/issues/754. Thanks

👍 1
whilo 2025-09-30T16:12:15.985389Z

@jeremys are you blocked on this? also, what direction are you interested in?

2025-09-30T16:17:52.204309Z

I am not blocked, I discovered this while making a tiny helper to declare schemas. I have fixed my helper so that it ensures the :db/ident is the first thing that goes into the map declaring the tuple schema. Since then I can move on to playing with datahike, no problem. Still someone else might randomly come up on this and be as puzzled as I was. Better to report it then.

whilo 2025-09-30T16:18:42.000309Z

for sure, this should not happen

2025-09-29T15:45:15.865189Z