This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-29
Channels
- # aleph (1)
- # announcements (10)
- # aws (1)
- # beginners (110)
- # calva (4)
- # cider (26)
- # clj-kondo (14)
- # cljdoc (24)
- # cljsrn (16)
- # clojure (76)
- # clojure-europe (3)
- # clojure-ireland (2)
- # clojure-italy (15)
- # clojure-nl (8)
- # clojure-spec (23)
- # clojure-sweden (4)
- # clojure-uk (92)
- # clojurescript (37)
- # cursive (19)
- # datomic (59)
- # duct (1)
- # emacs (4)
- # fulcro (7)
- # graalvm (7)
- # graphql (1)
- # hoplon (69)
- # jobs (4)
- # jobs-rus (1)
- # kaocha (2)
- # leiningen (5)
- # luminus (2)
- # pathom (8)
- # reagent (6)
- # reitit (11)
- # spacemacs (12)
- # sql (3)
- # tools-deps (9)
- # unrepl (1)
- # vim (57)
hi guys. I'm trying datomic cloud for the first time. I have used datomic on prem for several years. I am transacting a schema that I developed against an 'on prem' database and I get this error
Execution error (ExceptionInfo) at datomic.client.api.async/ares (async.clj:56).
Unable to resolve entity: :db/index
I know there was regret about the :db/index true
attribute in datomic schema
has this been eliminated in datomic cloud?
I definitely do want this attribute to be in AVET
https://docs.datomic.com/cloud/schema/schema-reference.html#org8d7d7c2 @ben.hammond there are slight differences
does that page describe the differences?
oh there's no [:db.fn/cas
neither 8(
Caused by: clojure.lang.ExceptionInfo: Unable to resolve data function: :db.fn/cas
at datomic.client.api.async$ares.invokeStatic(async.clj:56)
at datomic.client.api.async$ares.invoke(async.clj:52)
at datomic.client.api.sync$eval18317$fn__18322.invoke(sync.clj:83)
at datomic.client.api.protocols$eval16202$fn__16238$G__16187__16245.invoke(protocols.clj:58)
at datomic.client.api$transact.invokeStatic(api.clj:172)
at datomic.client.api$transact.invoke(api.clj:155)
that was what I hoped
thank you
is there a specific doc describing the differences between cloud and on-prem?
everyone must have gone through these pain points once
ah doesn't quite cover these details though
I don't feel so bad about asking then
Can I use lacinia-pedestal with HTTP Direct? I keep getting a 500 error when it worked fine as a Lambda function…
@hadilsabbagh18 Can you show the handler function and the ion-config?
Sure.
{:allow [
;; transaction functions
stackz.db/inc-attr
stackz.db/xact-coll
;; query functions
;; lambda handlers
stackz.schema/build-database
;; web applications
stackz.dwolla/web-handler
stackz.plaid/web-handler]
:lambdas {:build-database
{:fn stackz.schema/build-database
:description "Builds the database if not already installed."}
:dwolla
{:fn stackz.dwolla/web-handler
:integration :api-gateway/proxy
:description "Handles POST webhook calls from Dwolla"}
:plaid
{:fn stackz.plaid/web-handler
:integration :api-gateway/proxy
:description "Handles POST webhook calls from Plaid"}}
:http-direct {:handler-fn stackz.graphql/web-handler}
:app-name "stackz-dev"}
(defn sm
[interceptors schema graphiql?]
(lacinia/service-map schema {:graphiql graphiql? :interceptors interceptors}))
(def service
(-> (load-schema)
(lacinia/default-interceptors {:graphiql false})
(lacinia/inject jwt-interceptor :replace ::lacinia/inject-app-context)
(sm (load-schema) false)
(assoc ::http/chain-provider provider/ion-provider
::http/resource-path "/public"
::http/allowed-origins {:creds true})))
(defn handler
"Ion handler"
[service-map]
(-> service-map
cast-log
http/default-interceptors
http/create-provider
cast-log))
(defn web-handler
[request]
(handler service) request)
@hadilsabbagh18 try to print/log (get ctx :headers)
before the last leave
Could be related with it:
https://github.com/pedestal/pedestal.ions/issues/3
@hadilsabbagh18 Can I see your original ionized version?
Looking at the second link, it has the ion-config from the ion-starter repo. That references items-by-type
directly, NOT items-by-type-ionized
.
That didn't work when I tried it, because it takes the request argument explicitly (as a defn).
When I did the apply it gave a result that the body was an InputStream, not a String. That's progress…
I think you should try to deploy it right now, regardless of what it says locally with apply, and see what the results are. This is on a production topology correct? http-direct is only on a production topology, not a solo topology.
I did. Here's the results:
{"message":"Invalid request: java.io.BufferedInputStream cannot be cast to java.lang.String"}
@lanejo01 @marshall I believe that I don't need the Ion provider anymore, but I don't know how to disable Jetty from being used here. The Ion provider is expecting data from an ionized request, not the raw request from API Gateway.