This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-29
Channels
- # beginners (14)
- # boot (83)
- # cider (13)
- # cljsrn (4)
- # clojure (240)
- # clojure-argentina (1)
- # clojure-berlin (2)
- # clojure-canada (1)
- # clojure-dusseldorf (1)
- # clojure-greece (2)
- # clojure-india (2)
- # clojure-japan (2)
- # clojure-russia (23)
- # clojure-taiwan (2)
- # clojure-uk (12)
- # clojurescript (138)
- # cursive (6)
- # datomic (36)
- # hoplon (245)
- # jobs-discuss (35)
- # lein-figwheel (4)
- # melbourne (2)
- # off-topic (1)
- # om (26)
- # om-next (2)
- # onyx (23)
- # proton (8)
- # quil (1)
- # re-frame (9)
- # ring-swagger (2)
- # untangled (10)
- # yada (6)
I didn't have time to elaborate before, but I mean something like:
(d/q `[:find [(pull ?e ~pull-exp) …] :in $ [?e …]] db eids)
I don't think that syntax quote/unquote will actually work, but hopefully you get the idea
yeah that could work, thanks @bhagany
and I can just make the pull-exp
an argument as well
@tomjack: I have a very long list of eids
and I wanted to test if batching the query together would be more performant.
I believe the query engine parallelizes stuff under the hood.
I suppose I could use pmap
myself but hopefully I can rely on people smarter than me to do the parallel stuff.
@casperc: (count (distinct (map :e (d/datoms db :eavt))))
^^ that will count ALL entities, including entities which describe the schema and datomic structure itself
@bostonaholic: Thanks, I guess I was hoping for to be able to count just the “user entities”, but this is close enough for now
hi. i'm trying to run the datomic transactor on an m4 aws instance but getting errors like this: https://groups.google.com/forum/#!topic/datomic/IXsSUqMkgGo
unfortunately that doesn't seem to quite suggest a solution for me. in this case i'm just trying to use the dev adapter but seem to be having host problems
i got around this before by having a fixed dns entry that referenced the machine, but in this case i can't do that because this is on a testing instance that is self containing and many copies of will spin up/down
gworley3: what are your host and alt-host params in your transactor.properties file?
@casperc: you can modify what @bostonaholic provided and use :aevt :user/id (replace with whatever attribute will limit results to those entities). You can also write a query with and use the count aggregate.
[:find (count ?e)
:where
[?e :user/id]]
@matthavener: host=localhost. alt-host not set
are you using datomic free (h2 storage) with your tests?
from the exception, it looks like H2 storage org.h2.jdbc.JdbcSQLException
i’ve had issues with that when the host doesn’t know its ‘real’ IP (docker).. i had luck setting host=0.0.0.0 and alt-host=<real host ip>
but that was with H2 storage, which is why I asked
@matthavener: hmm, none of that seems to work whether i use public or private ip addresses or if i use aws supplied dns entries for those two or not. same effect if i use host or alt-host
ah, i see, seems this is a known issue with h2: http://stackoverflow.com/questions/1881546/inetaddress-getlocalhost-throws-unknownhostexception
the (unfortuante) solution seems to be to modify /etc/hosts (i did this and it worked)
@gworley3: in general, I don’t work with dev transactors on ec2 instances, but maybe worth noting that the Datomic generated AWS cf sets host
and alt-host
as follows:
"host=`curl http:\/\/169.254.169.254\/latest\/meta-data\/local-ipv4`",
"alt-host=`curl http:\/\/169.254.169.254\/latest\/meta-data\/public-ipv4`",
i'm actually not too picky here. i was only using dev because it seemed easiest. i'm trying postgres now to see if that gets around the issue since i'm already running it on these boxes anyway
okay, looks like using sql with postgres works. thanks @matthavener for pointing out about h2. that led me to avoiding it to get around this