I figured out a way to use refs in my schema to solve my problem... Thanks 🙂
Your destructuring doesn’t make sense to me. What is ?e2 supposed to be?
The only choices you have for destructuring are to take the value as a whole unchanged, to take it as a collection of single items, or to take it as a collection of relations.
I think you either want args [db [ref1 ref2]] :in [$ [?e ...]] or args [db [ref1][ref2]] :in [$ [?e...] [?e2 ...]]
You are doing args [db [ref1 ref2]] :in [$ [[?e ...][?e2 ...]]]
The query parser isn’t catching this as a syntax error but it should
You're right; when i initially reported this issue I used
[db [ref1][ref2]] :in [$ [?e...] [?e2 ...]]
instead of the syntax in the repro. Let me get an example ready.I updated my example to be more in line with my original report. Sorry for the noise 😅
maybe someone can help me solve a mystery. i'm replaying my transaction log into a new database and ran into a snag at this datom, which is adding a fact about a reference to entity 69269232556469022
. the weird thing is that 69269232556469022
hasn't appeared in the transaction log up until now
(seq (d/tx-range conn {:start 64289 :end 64290}))
=>
({:t 64289,
:data [...
#datom[67580382696205085 715 69269232556469022 13194139597601 true]
...]})
and when i query its history it seems to have never existed
(d/q '{:find [?mystery ?a ?v]
:in [$ ?mystery]
:where [[?mystery ?a ?v]]}
(d/history (d/db conn))
69269232556469022)
=> []
attribute 715
is a standard reference with history enabled by default (though i don't think that would make a difference here, since it's the entity itself that seems to be missing)
any idea what's going on?What is attr 715?
i've changed the ident name of the attribute below, but other than that it looks like this
#:db{:id 715,
:ident :album/artist,
:valueType #:db{:id 20, :ident :db.type/ref},
:cardinality #:db{:id 35, :ident :db.cardinality/one},
:doc "A reference to the artist of an album"}
i don't know if it's related but 715 in my original post would have likely been pointing to a composite tuple entity with a uniqueness constraint by identity
In the old or the new db?
this is all in the old db before we get to the part of replaying the tx in the new db
@joshkh Is this on dev-local, cloud, on-prem?
Can you send back a report of running:
1. (d/pull (d/db conn) '[*] 69269232556469022)
2. (d/pull (d/as-of (d/db conn) 64288) '[*] 69269232556469022)
3. (d/pull (d/as-of (d/db conn) 64289) '[*] 69269232556469022)
4. (d/pull (d/as-of (d/db conn) 64290) '[*] 69269232556469022)
5. (d/pull (d/as-of (d/db conn) 64291) '[*] 69269232556469022)
You can dm me or send this to support.