This is a thought experiment, obviously this is not real datomic!
Why do this? I think it would cancel out data transformation boilerplate currently needed to do something like this.
(defn user-uuid-to-user [user-uuid]
(d/q [:in $ ?user-uuid
:find ?user . ; no pull here, bind it later
:where [?user :user/uuid ?user-uuid]]
*$* user-uuid))
(d/pull $ [:domain/ident
{:hyperfiddle/owners ; :many :uuid
[{user-uuid-to-user ; a fn that navs deeper, takes uuid as input
[:user/name ; now we can pull deeper as if the relation was a ref
:user/email]}]}]
[:domain/ident "tank"])
Someone who understands rules can probably make this simpler.
FWIW this is how you might express the uuid<->user relation with rules (but it doesn't add much in this case):
But yeah so right now I think Datomic can't do any kind of filtering within pull. You'd have to re-write as something like:
etc...
In PullQL we'd write this as
We don't do query caching / inputs yet, but that's the idea. But in any case I think it makes sense to have something like that, yes.