Looks interesting! Was Crux an easy choice? Did you consider any other databases (non-Datalog)? Or Datahike?
{[:users #uuid "some-user-uuid"] {:db/merge true
:username "foo"}}
gets converted to [[:crux.tx/put (merge (crux/entity db #uuid "some-user-uuid")
{:username "foo"})]]
There is a race condition though; if another tx updated that document after the crux/entity call but before `:username "foo"` was written, then that tx would get clobbered. I'm planning to add `:crux.tx/match` operations automatically to prevent that from happening. There was talk on #crux in Clojurians slack today of using the newly-added transaction function feature to do merges. Haven't looked into that myself.(crux/submit-tx [[:crux.tx/fn :crux.fn/assoc doc-id k v]]) ```