Fork me on GitHub
#datalevin
<
2024-04-25
>
plexus10:04:48

I noticed some things with datalevin entity objects that were quite surprising to me. Are these intentional? keys does not include :db/id, or any staged keys, which means conversion to a plain map is incomplete

(:db/id (d/entity foo)) ;;=> 86
(:db/id (into {} (d/entity foo))) ;;=> nil

(:foo (assoc (db/entity foo) :foo "123")) ;;=> 123
(:foo (into {} (assoc (db/entity foo) :foo "123"))) ;;=> nil
are both of these intentional?

Huahai15:04:15

Probably not intentional. PR welcome.

Huahai15:04:48

Or file an issue.

Huahai18:04:51

Datascript probably behaves the same. But this can be addressed. It's inconsistency.

plexus06:04:31

thanks, I'll see if I can do a PR, or at least file an issue