Fork me on GitHub
#datalevin
<
2024-07-10
>
Tommy Jolly21:07:24

Hello! If I have a list of numbered entities, [{:e/id 0} {:e/id 1} ,,,], transact it in (in a single transaction), will the :db/id's maintain the same sort-order as my own :e/id ? I'm asking because I'm shuffling a list of entities before transacting it in, and I suspect they're coming out in a less random order (which perhaps I can "fix" by sorting by :db/id)

Huahai21:07:53

If your transaction data follows :e/id order, yes

Huahai21:07:00

Entity ids follows transaction data order

1
Tommy Jolly22:07:57

Thanks for the confirmation! And all your hard work 🙂

Tommy Jolly23:07:54

One more thing — am I right in thinking that unlike other Datomic-likes, DL entities can be arbitrarily modified & transacted back in?! Something on github seems to imply they keep a "staging area" of changes, to make this efficient for modified data at arbitrary depths. Can I use them wherever I'd use a map, like (transact! conn [{:new-thing/ref my-entity}])? My current code is littered with messy pull-specs, and I'm passing around maps with various "bits" hanging off, making it feel awkwardly coupled all over the place.