Fork me on GitHub
#datomic
<
2016-11-02
>
psavine4201:11:23

deleted my m2, same problem. when checking netstat, i do not see the datomic ports in use... however i can still do (get-database-names "...") . some part of transactor is just not happening ๐Ÿ˜ž

marshall01:11:42

ClassNotFound definitely suggests class

marshall01:11:54

A classpath issue

marshall01:11:29

The get-database-names call doesn't require communication with the transactor

marshall01:11:41

I'd look at the transactor logs, possible you may find underlying issue there

marshall01:11:38

@georgek ditto ^ do you see anything in transactor logs?

karol.adamiec09:11:40

@robert-stuttaford #uri complains RuntimeException No reader function for tag uri clojure.lang.LispReader$CtorReader.readTagged

karol.adamiec09:11:57

@jaret (java.net.URI. ") works from datomic REPL, but 500 for curl ;(

karol.adamiec09:11:35

BTW: is there a way to get more meaningfull errors than 500 to anything that is wrong with REST service? it is rather annoying ๐Ÿ˜

robert-stuttaford09:11:40

coulda sworn there was one for java.net.URI

karol.adamiec09:11:59

will check quickly how about curling #uri

karol.adamiec09:11:53

nope, 500 ๐Ÿ˜ž

karol.adamiec09:11:28

@robert-stuttaford i tried #uri from datomic repl

karol.adamiec09:11:44

maybe it is available in a full env...

karol.adamiec09:11:05

but i need to use REST endpoint, at least for nowโ€ฆ.

karol.adamiec09:11:41

also found Stuart Halloway mentioning that URI is a memory hogโ€ฆ so maybe best practice is to actually avoid that and use strings?

karol.adamiec09:11:44

that was my first instinct when modelling, but then noticed that uri type and hey! looks cool ๐Ÿ™‚

karol.adamiec09:11:56

so i was baited into it ๐Ÿ˜†

karol.adamiec09:11:53

strings then. But still i do consider it to be actually a real PITA that docs do not mention that one can not insert URI datatype using rest. OR if one can, how to do it. ๐Ÿ˜ž

robert-stuttaford10:11:04

a short-coming, to be sure

Matt Butler16:11:18

Is there a simple way to get datomic to return me all the attributes under a certain ns? user/### or do I have to get all the attribute idents and do some pattern matching on them ๐Ÿ™‚

yonatanel16:11:53

Is a where clause like [?e :entity/status _] equivalent to not adding it at all?

yonatanel16:11:25

I just tried and the attribute must exist.

Matt Butler16:11:51

It should match on any entity has that attribute but any value @yonatanel

yonatanel16:11:04

@mbutler Thanks. I wanted to parameterize the query with the desired status or not checking status at all, but without concat.

Matt Butler17:11:23

Sorry, not sure I 100% follow, is your problem solved? Or are you saying you want it to match on either a status value you pass in or ignore it? Code example might help ๐Ÿ™‚

yonatanel17:11:09

@mbutler Well, I use concat to build the query according to some parameter. I either include a clause for the status or not include it at all (matching either on a value or ignoring it). I wanted to avoid concat but not sure it's possible or if there's any benefit to it like the query will somehow be optimized.

Matt Butler17:11:55

when you dont include it do you want it to match on any value of :entity/status or match even if there isnโ€™t an :entity/status attribute on that entity

yonatanel17:11:36

I want to match even if the attribute is missing

yonatanel17:11:00

Maybe [(get-else $ ?e :entity/status :none) _]

Matt Butler17:11:22

That should work

Matt Butler17:11:38

An or should work as well

yonatanel17:11:22

Actually the whole thing is pointless since I need to alter the query according to some variable. Never mind.

Matt Butler17:11:37

No problem ๐Ÿ™‚

Matt Butler17:11:44

Good luck ๐Ÿ™‚

Matt Butler18:11:30

For anyone curious here is the query I ended up with to find all attributes of a certain ns

(d/q '[:find ?ident
         :in $ ?input-ns
         :where
         [?e :db/cardinality _]
         [?e :db/ident ?ident]
         [(namespace ?ident) ?ns]
         [(= ?ns ?input-ns)]] database input-ns)
Interestingly I couldnโ€™t use :db.install/_attribute :db.part/db as a safety check that I was talking about an attribute, I assume because that attribute entity lives in the db.part/db and not user. Anyone know if there is another check I could do or is cardinality safe enough?