datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
oly 2020-08-25T08:44:17.010300Z

(d/q '[:find ?e ?i ?n ?slug  (count ?eid2)
                :keys eid id product/name product/slug ?prices
                :in $ ?product-id
                :where
                [?e :product/id ?i]
                [?eid2 :price/product ?prices]
                [?e :product/name ?n]
                [?e :product/slug ?slug]] @conn product-id)

oly 2020-08-25T08:45:02.010500Z

That's what i currently have, I can split it out in this situation but Its something that would be good to know how to achieve