Fork me on GitHub

What error is this? Why am I only limited to use find-rel ?


Datomic client API doesn't support all the find specs that the peer API supports. See for what is supported.


@U083D6HK9 So shall I use the peer server in case I'd like to do such query?


This is the query I am trying to run


@vincenz.chianese change your find to: :find ?name ?surname


then you can manipulate the collection(s) returned in your client application if necessary


Yeah, I was trying to avoid such boilerplate per each query @marshall


Because I'm receiving something like [[{"name": "name", "surname": "surname"}]]


That's kind of weird as structure (although I am sure there's a reason for that


you could pull in the find


i.e. :find (pull ?id [:name :surname])


I tried that but I think that still gave me a weird structured result


Indeed: [[{"person/name":"Porcesco","person/surname":"Gerbone"}]]


That's the same result I'm regularly getting using the regular query


After recently changing a backend stack from AWS Appsync -> AWS Lambda -> Datomic ions -> to AWS Appsync -> HTTP direct -> API Gateway -> Datomic ions I am now getting errors like

Syntax error compiling at (clojure/data/xml/event.clj:1:1)
java.lang.IllegalAccessError: xml-str does not exist

Syntax error compiling at (clojure/data/xml/impl.clj:66:12).
java.lang.IllegalAccessError: element-nss does not exist

Syntax error compiling at (******/aws/cognito.clj:20:38).
java.lang.RuntimeException: No such var: aws/invoke
They happen every now and then with seemingly no way to reliably reproduce them and never happened when calling ions via Lambdas. I have updated ion, ion-dev, client api, datomic storage and compute to latest as of current date with no effect. Does anyone have ideas where to look for hints or what could be a cause for such behaviour?


There is one major change compared to the Lambda configuration - I am now resolving functions in other namespaces based on routes. Could this have any effect and if so then why? There are no errors with resolving these functions tough.

Alex Miller (Clojure team)19:10:06

those all look like they could be a case of not having the expected version of a dependency (OR that it's asynchronously loading and you're seeing partial state)

Alex Miller (Clojure team)19:10:19

when you resolve functions, how are you doing it?

Alex Miller (Clojure team)19:10:39

I would recommend using requiring-resolve


I parse a string to a symbol and then resolve it e.g. (when-let [f (resolve 'app.ions.list-something/list-something)] (f args))

Alex Miller (Clojure team)19:10:41

so you're not ever dynamically loading namespaces?

Alex Miller (Clojure team)19:10:36

I mean, where does 'app.ions.list-something coming from? is that a dynamic value?


I get a string from a route e.g. list-something and then I convert it into a symbol app.ions.list-something/list-something and then resolve it. Just like in the datomi cion starter example


Fixed my examples 😊. I guess I’ll try requiring-resolve .


and I am also requiring the namespace dynamically just like in that example (-> ion-sym namespace symbol require)


This is my http direct handler fn

(defn handler
  [{:keys [uri] :as req}]
    (let [arg-map (-> req parse-request validate authenticate)
          {:keys [ion-sym]} arg-map]
      (-> ion-sym namespace symbol require)
      (let [ion-fn (resolve ion-sym)]
        (when-not ion-fn
          (throw (ex-info ...)))
        (ion-fn arg-map)))
    (catch ....)))

Alex Miller (Clojure team)20:10:10

yeah, I would strongly recommend requiring-resolve - it uses a shared loading lock


I changed resolve -> requiring-resolve . The issue still persists with the exception that now only specific namespaces fail and in almost 100% of cases. What makes them different is that they implement cognitect aws api and fail at cognitect/aws/client.clj 😕

Alex Miller (Clojure team)20:10:17

what does "they implement cognitect `aws api` " mean? they == what? implement == what?

Alex Miller (Clojure team)20:10:54

aws api does do some dynamic loading but should be doing safer things already


If I resolve and execute a symbol that uses to invoke an operation on an AWS service then I always get Syntax error compiling at (cognitect/aws/client.clj…). I added (:require []) to the handler namespace and seem to get no syntax error compiling at errors anymore. I guess it’s a fix for now.

Alex Miller (Clojure team)21:10:29

yeah, don't know off the top of my head but that would have been my suggestion

Brandon Olivier22:10:48

Does the Datomic client lib support fulltext ?