Fork me on GitHub

Do you no longer need to use: :db/id #db/id[:db.part/person]? Seeing the docs now reference: [{:db/ident :person/name


Hey anyone have a solution to combine pull expressions with aggregation in a single query?


For example, I know that pull expressions don’t support count, but is there a way to get a count included in the pull result?


@chelsey not as far as i can tell. Datalog’s pull expressions really just compose with d/pull directly. other than the argument order, i don’t think there’s any difference between the implementations


happily, though, you can just use multiple queries


Thanks Robert! Can you explain what you mean by multiple queries? Do you mean running d/q multiple times?


Let me give you a bit more context: Essentially, I have a Reddit-like tree structure, where there is no distinction between posts and comments. On top of this, “likes” are themselves entities, which I can retrieve easily with pull, but also need to return a count. I realize I can transform the data afterwards but was hoping there was a cleaner way of doing this.


@chelsey well, i know your pain. it takes a lot to internalize that unique treat of datomic. Running multiple queries and post processing them IS the clean way in some sense (or to put it differently it definitely is not dirty!). we are not in kansas anymore 🙂


on top of that multiple q could be more reusable as well….


@chelsey yes. or any combination of d/q d/entity d/pull. once you have that db value, you can query against it as much as you like, and your view on the data will be consistent


@karol.adamiec ahh it is painful, but I’ll accept it ¯\(ツ)


@chelsey think of Datomic less like a store of data ‘over there’ and more like a neat way to talk about data ‘over here’


sometimes you use map, filter, etc, and sometimes you use d/q, d/pull, etc. and very often you combine them


Datomic handles the ‘over-there’ness for you


Our infrastructure team has configured our sql storage to use “Always on HA” for read-scale ( They assured me that it should be transparent to readers, but I’m curious if that sounds off.