This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-11
Channels
- # beginners (109)
- # boot (61)
- # cider (8)
- # clara (3)
- # cljs-dev (67)
- # cljsrn (5)
- # clojure (96)
- # clojure-argentina (1)
- # clojure-brasil (2)
- # clojure-greece (10)
- # clojure-russia (114)
- # clojure-spec (51)
- # clojure-uk (45)
- # clojurebridge (2)
- # clojurescript (139)
- # cursive (18)
- # data-science (1)
- # datascript (2)
- # datomic (13)
- # dirac (2)
- # emacs (5)
- # events (1)
- # javascript (2)
- # jobs (1)
- # juxt (3)
- # off-topic (62)
- # om (10)
- # onyx (12)
- # perun (7)
- # ring-swagger (7)
- # specter (21)
- # test-check (5)
- # untangled (16)
- # utah-clojurians (1)
- # yada (2)
Realized that the replace function doesn’t work, need to use com.rpl/specter or something similar to get it work.
@teng I've sometimes assemble them by not quoting everything. So [:find (list 'pull '?user-id your-pull-pattern)]
Note you can also use maps instead of vectors for a query. That sometimes simplifies things
@rauh Feels like I should create a macro that can both substitute and quote the rest of the content!
The quoting reduces the readability, but it’s probably ok for now. Sounds like it should be a solved problem already ?!
You might look into quoting with backtick and tilde, maybe: `[:find [(pull ...) ...] :where ~where-clauses]
I agree that this seems like the type of thing specter would be good at
@rauh @teng Wouldn't it be easier to pass the pull pattern as a :in
query parameter? (third code sample at http://docs.datomic.com/query.html#pull-expressions)
@yonatanel Yes, but IIRC the queries get cached, and if you pass in the query as a parameter than it won't be. So it might be slower
@rauh I'm referring to parameterize the query itself, and so making the query data structure constant and cachable while the pull pattern changes. (http://docs.datomic.com/best-practices.html#parameterize-queries)
@yonatanel Yes I know, I just don't know if --for example-- datomic caches some kind of query plan if you pass in a pull
with constant arguments. I also don't like to make something dynamic when it's really actually known at compile time.