Fork me on GitHub

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


@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. (


@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.


OK. Would be interesting to know if datomic cares about pull patterns when it caches queries. I was under the impression that @teng's use case is to provide a pattern remotely at runtime.