datalevin

simongray 2024-11-05T08:56:39.634759Z

I think I found a bug: In the docstring of datalevin.core/entity it says: >

If entity does not exist, `nil` is returned:
> 
>     (entity db 100500) ; => nil
however, if I try to call e.g. (d/entity conn 999999999999999999) I just get back >
{:db/id 999999999999999999}

simongray 2024-11-05T13:46:54.864679Z

How do get data from an entity? I’m trying to encode it as transit and it isn’t working since it’s its own type. Clojure.datafy isn’t implemented for Datalevin’s Entity type.

Huahai 2024-11-09T01:21:57.571529Z

datafy is already implemented on pulled entities. Please see datalevin.test.datafy. Let me know what else is on your mind

Huahai 2024-11-09T01:22:09.474499Z

On a second look, I would rather change the doc string, as I found that there's actually a test to ensure the above behavior. Also, there will be problem with remote entity. So I will keep the behavior and change the doc string instead.

simongray 2024-11-05T14:05:03.516399Z

I don’t quite understand why/how I can touch an entity and it prints fine in the REPL, but this data structure somehow isn’t available to me ?

2024-11-05T17:01:16.820199Z

Can you transfer it to a standard map with (into {} the-entity)?

Huahai 2024-11-05T20:22:54.960829Z

https://github.com/juji-io/datalevin/issues/292

simongray 2024-11-06T09:27:01.700709Z

Thanks for listening, @huahaiy !