This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-20
Channels
- # announcements (26)
- # babashka (1)
- # beginners (15)
- # biff (6)
- # cider (3)
- # circleci (1)
- # clj-kondo (33)
- # clojure (23)
- # clojure-denver (13)
- # clojure-europe (22)
- # clojure-norway (2)
- # clojurescript (45)
- # conjure (2)
- # datascript (4)
- # datomic (8)
- # events (5)
- # ghostwheel (2)
- # gratitude (4)
- # hyperfiddle (5)
- # jobs (5)
- # music (1)
- # off-topic (19)
- # pathom (4)
- # portal (25)
- # reitit (4)
- # releases (1)
- # shadow-cljs (28)
- # specter (2)
- # xtdb (23)
I have a sneaking suspicion that :xt/id
is the one attribute I can't feed into biff/submit-tx
's :db.op/upsert
to check to see if the associated doc is already in the database.
hm, not sure if that does or doesn't work, but either way it shouldn't be necessary--you can just use :db/op :merge
to get the same effect. :db.op/upsert
is just there so you can update/insert docs on non-`:xt/id` keys, since XTDB already ensures that the :xt/id
key is unique.

(As an aside, migrating to/adding support for XTDB 2.0 will provide a good opportunity to rethink Biff's transaction format and try to sand off some of the unintuitive edges like this...)
Ah! :db/op :merge
did the trick! Just when I was about to rethink my whole approach.
I think I sussed out my mistake. When the :upsert
didn't find the :xt/id
I supplied, it created a new doc but instead of using the :xt/id
I gave it, it rolled up a random uuid. Which makes sense and is exactly what the documentation told me what would happen. I just got so used to using :upsert
with other attributes, I didn't think it through.
ah yes, that makes sense. in any case I think it'd be worthwhile to have a unified format for doing upsert, whether it's with xt/id or another key