Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- ```clojure
- (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.
Add Comment
Please, Sign In to add comment