What error is this? Why am I only limited to use find-rel
?
@kenny 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
Datomic client API doesn't support all the find specs that the peer API supports. See https://docs.datomic.com/cloud/query/query-data-reference.html#find-specs for what is supported.
@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.
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)
when you resolve functions, how are you doing it?
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))
so you're not ever dynamically loading namespaces?
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 https://github.com/Datomic/ion-starter/blob/7d2a6e0bda89ac3bb4756501c3ada3d1fbc80c1a/src/datomic/ion/starter.clj#L26
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}]
(try
(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 ....)))
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
😕
what does "they implement cognitect `aws api` " mean? they == what? implement == what?
aws api does do some dynamic loading but should be doing safer things already
If I resolve and execute a symbol that uses cognitect.aws.client.api to invoke an operation on an AWS service then I always get Syntax error compiling at (cognitect/aws/client.clj…)
.
I added (:require [cognitect.aws.client.api])
to the handler namespace and seem to get no syntax error compiling at
errors anymore. I guess it’s a fix for now.
yeah, don't know off the top of my head but that would have been my suggestion
Does the Datomic client lib support fulltext
?