Fork me on GitHub

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 ๐Ÿ˜ž


ClassNotFound definitely suggests class


A classpath issue


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


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


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


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


@jaret ( ") works from datomic REPL, but 500 for curl ;(


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


coulda sworn there was one for


will check quickly how about curling #uri


nope, 500 ๐Ÿ˜ž


@robert-stuttaford i tried #uri from datomic repl


maybe it is available in a full env...


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


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


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


so i was baited into it ๐Ÿ˜†


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. ๐Ÿ˜ž


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 ๐Ÿ™‚


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


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


@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 ๐Ÿ™‚


@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


I want to match even if the attribute is missing


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

Matt Butler17:11:22

That should work

Matt Butler17:11:38

An or should work as well


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
         [?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?