This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-27
Channels
- # bangalore-clj (1)
- # beginners (11)
- # boot (23)
- # business (2)
- # cider (43)
- # cljs-dev (65)
- # cljsjs (17)
- # cljsrn (4)
- # clojure (144)
- # clojure-austin (4)
- # clojure-berlin (3)
- # clojure-finland (4)
- # clojure-nl (2)
- # clojure-russia (13)
- # clojure-spec (73)
- # clojure-uk (42)
- # clojured (2)
- # clojurescript (166)
- # core-matrix (4)
- # cursive (24)
- # datomic (39)
- # dirac (8)
- # hoplon (97)
- # jobs (2)
- # jobs-rus (11)
- # juxt (16)
- # lein-figwheel (8)
- # leiningen (1)
- # luminus (5)
- # lumo (46)
- # off-topic (1)
- # om (39)
- # onyx (43)
- # overtone (1)
- # pedestal (3)
- # perun (6)
- # play-clj (3)
- # protorepl (14)
- # re-frame (21)
- # reagent (25)
- # remote-jobs (1)
- # ring (1)
- # robots (4)
- # rum (13)
- # specter (5)
- # untangled (72)
- # yada (62)
> Datomic Pro is issued with a perpetual license, with ongoing maintenance fees of $5,000 per year per system. (source: http://www.datomic.com/get-datomic.html) What is the definition of "system" in this context?
(let [db (d/db conn)
blurb-ids (d/q '[:find [?blurb ...] :in $ :where
[?blurb :blurb/attr-only-asserted-when-created]]
(d/since db #inst "24 hours ago"))]
(d/pull-many db '[*] blurb-ids))
no need to use d/log at all. just query a database that only has datoms from the period you care about.
you don’t need to use datalog either:
(->> :blurb/attr-only-asserted-when-created
(d/datoms (d/since db #inst "24 hours ago") :aevt)
seq
(map :e)
(d/pull-many db '[*])
note that we only use the time-constrained database for the initial seek; the ‘now’ db for the rest, because you may want to query for things asserted in the past (e.g. relationships to previously existing entities, like author etc)
potentially dumb question, but how would i construct a :where
so that i can pass a sequence of potential values something can match?
e.g. a list of entity ids
@misha with the ...
?
kk 1 sec, i'll try that out 🙂
so is ...
some clojure syntax i haven't learned yet?
ah ok, so specific to datomic?
cool, makes sense
not sure why i couldn't find this before
probably putting the wrong words into google 😛
tbh i've read over it a few times on different occassions, but it sinks in better when i have a real problem to solve
@thedavidmeister a slow, careful read of http://docs.datomic.com/query.html will save you a lot of time
@robert-stuttaford Beautiful. Thank you kindly. So the first step asks the query over a specific time-constrained db, and the second uses that info against the Now version to get all the good stuff, if I'm understanding correctly.
precisely @sova
Yes. single production transactor You can, of course, also have an HA transactor for that prod system and as many dev/staging/testing instances as you require
Is it possible with datomic/q
to “map” a pull expression over multiple entities in a single query?
(I am not sure why this exists vs just d/pull
with map
. Maybe it can be more efficient?)
Also not documented for some reason is that the pull find expression can take a database, (pull $ ?e [:pull-expr])