I am currently working on porting my clojure application (with poop) to the Datomic framework and was in a loop when I translated requests. I understand that queries are not completely flexible (compared to korma), for example, I would like to evaluate conditional sentences around different variables.
Given the korma request,
(select users (where (or (and {:first_name [= "user"]} {:last_name [= "sample"]}) {:email [= " user.sample@email.com "]})))
can it be converted to datomic, with something like this?
[:find ?e :where (or (and [?u :user/first-name "user"] [?u :user/last-name "sample"]) [?u :user/email " user.sample@email.com "])
but this is not recommended for queries (according to the Datomic docs), since all sentences used in a sentence or must use the same set of variables. How to set an OR clause for different sets of variables?
source share