datahike

https://datahike.io/, Join the conversation at https://discord.com/invite/kEBzMvb, history for this channel is available at https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive/topic/datahike
grounded_sage 2020-03-12T21:15:36.033900Z

So far best solution I can find is this. I’m sure there is a more elegant solution.

(conj
    (d/q '[:find (pull ?e [*]) (pull ?e1 [*]) (pull ?e2 [*]) 
           :where
           [?e  :customer/address-id ?address-id]
           [?e1 :address/address-id ?address-id]
           [?e2 :bank/address-id ?address-id]]
         @conn)
    (map #(conj % {:bank/name ""})
         (d/q '[:find (pull ?e [*]) (pull ?e1 [*]) 
                :where
                [?e  :customer/address-id ?address-id]
                [?e1 :address/address-id ?address-id]
                (not
                 [?e2 :bank/address-id ?address-id])]
              @conn)))