This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-09
Channels
- # beginners (121)
- # boot (28)
- # cider (106)
- # clara (57)
- # cljs-dev (70)
- # cljsrn (6)
- # clojure (145)
- # clojure-dev (7)
- # clojure-italy (36)
- # clojure-russia (42)
- # clojure-spec (26)
- # clojure-uk (127)
- # clojurescript (103)
- # core-async (10)
- # cursive (56)
- # datascript (66)
- # datomic (16)
- # defnpodcast (1)
- # emacs (18)
- # events (6)
- # figwheel (1)
- # jobs (1)
- # luminus (1)
- # lumo (44)
- # off-topic (58)
- # om (17)
- # onyx (2)
- # parinfer (75)
- # pedestal (4)
- # re-frame (18)
- # ring (4)
- # ring-swagger (8)
- # rum (7)
- # spacemacs (7)
- # specter (2)
- # sql (4)
- # unrepl (39)
- # untangled (17)
- # vim (3)
- # yada (21)
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 ¯\(ツ)/¯
@robert-stuttaford @karol.adamiec thanks to both of you 🙂
@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 (https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server). They assured me that it should be transparent to readers, but I’m curious if that sounds off.