hyperfiddle-2020
hyperfiddle-2020 copied to clipboard
Datomic lookup refs not mappable to :tempids lookup map when :db/id not pulled
This stage
[[:db/add "tempid-17592186047481-:link/fiddle-[:fiddle/ident :seattle/districts]" :fiddle/ident :a/yo]
[:db/add 17592186047481 :link/fiddle "tempid-17592186047481-:link/fiddle-[:fiddle/ident :seattle/districts]"]]
In conjunction with this query (note #_ :db/id)
[:find [(pull ?link [#_:db/id :fiddle/ident]) ...]
:where
[?link :fiddle/ident]]
Hyperfiddle will infer the best identity, and there isn't one, because the lookup ref is not good yet. But how can Hyperfiddle know that it isn't good yet without having pulled the :db/id necessary to inspect the tempid map?
https://forum.datomic.com/t/lookup-ref-upsert/826