In xtdb 1/datomic you can query reverse relationships by prepending an underscore to an attribute name. Is this kind of reverse relationship query possible in XTQL?
have you got a pseudo-code example of what you're trying to do?
(my initial thought is that this should be a slight adaptation in the call to nest-one/nest-many)
I answered my own question with this - unify does what I need
🙌 if possible, mind sharing it here in case others run into the same problem?
It turns out I didn't actually need the reverse relationship query for my use case, I was able to do what I needed with normal forward queries. I am storing dependency information in xtdb, and I wanted to ask questions like 'what entities are dependent on entity X, and via what relation?' In order to do that I was originally thinking that I would somehow walk backward from entity X through relationships, but afterwards I realized that I would not only need reverse relationships, but also to somehow ask which reverse relationships refer to entity X, which I don't think is something I can do in a query. After thinking this through more, I wound up essentially querying my dependency graph for things that refer to X, and then things that refer to those things, etc. - which I was able to do because I had stored enough meta information in my graph to know what the possible forward relationships were.
just came to mind, that in normal SQL, trying to insert with the same PK will fail due to primary key constraint (unless you provide some upsert clauses)… in XTDBv2 it succeeds with a new version.
I’m not saying that it’s a problem, just though of it that it is a marked difference
is there a way to “upsert”, the SQL syntax graph doesn’t show way to say that “if it exists, then (merge old new)”