Fork me on GitHub
#xtdb
<
2023-06-02
>
Nikolas Pafitis14:06:16

Is there a way to retrieve an entity and all other entities associated with it either directly or indirectly in XTDB (1.x) datalog query, without having to list every relationship? From my understanding it's impossible since vars in the attribute position are not supported. For example :

'{:find [child-name]
   :in [parent]
   :where [[parent :xt/id]
           (child-of parent child)
           [child :name child-name]]
   :rules [[(child-of p c)
            [p _ c]]
           [(child-of p c)
            [p _ c1]
            (child-of c1 c)]]}

jarohen15:06:14

hey @U0105D1EL4B - yes, this is correct

Nikolas Pafitis15:06:35

Will it be possible in Xtdb 2.x?

jarohen15:06:47

not likely, I'm afraid 😕