This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-22
Channels
- # beginners (124)
- # boot (7)
- # cider (73)
- # cljs-dev (37)
- # cljsrn (6)
- # clojure (85)
- # clojure-greece (4)
- # clojure-italy (67)
- # clojure-nl (6)
- # clojure-russia (4)
- # clojure-spec (6)
- # clojure-uk (48)
- # clojurescript (26)
- # cursive (5)
- # data-science (23)
- # datomic (63)
- # editors (5)
- # emacs (4)
- # graphql (13)
- # immutant (2)
- # lumo (4)
- # mount (3)
- # off-topic (1)
- # onyx (4)
- # pedestal (7)
- # portkey (10)
- # re-frame (14)
- # reagent (10)
- # ring-swagger (18)
- # shadow-cljs (97)
- # spacemacs (1)
- # tools-deps (9)
- # vim (1)
- # yada (13)
I couldn't ever figure out which port number to use so I just left it off and let it use the default port
okay, I set it to 8182 in the config map and it threw an error in my repl and the terminal where the proxy script was running terminated, so I restarted the proxy script and reran
(def client (d/client cfg))
and didn't get any errors, so it's working I guess? :man-shrugging::skin-tone-2:I spoke too soon >_<
user=> (d/create-database client {:db-name "movies"})
ExceptionInfo java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter clojure.core/ex-info (core.clj:4739)
in case anyone stumbles upon this conversation in the future: I had to update my deps.edn to add the module with an alias I named "my-ops"
{:deps
{com.datomic/client-cloud {:mvn/version "0.8.54"}}
:aliases
{:my-ops {:jvm-opts ["--add-modules" "java.xml.bind"]}}}
Then I started up clojure with the command line flag -O to use it clj -O:my-ops
and now I am able to do the thing I was trying to do for like two days now user=> (d/create-database client {:db-name "movies"})
true
šThanks @marshall for your assistance with that config mess. I'll to try to find where I read that the proxy-port key defaults to something if not provided. not sure if I ran into bad docs or if grossly misread something š
is it a bad idea to serve your appās root html from an ion? iām guessing the warmup time makes that impracticalā¦
@sekao it depend on usage patterns. Is your app in continuous use, and how many 9s of low latency response do you need?
@sekao and if you are playing the long game, don't sweat the specifics of the current integration too much, we can offer other integrations besides the Lambda proxy in the future
Iām going to repeat a question from yesterday because I think it got lost in the surrounding discussion, but if it doesnāt get any bites this time I wonāt bother the channel again. š
question about Ions: if I run say items-by-type
out of ion-starter
at the REPL I get a nice pretty string with an array of arrays in it, suitable for such activities as deserializing into JSON
when I invoke that ion as a Lambda, however, I get a nice pretty string that is the first string wrapped in a hashset (e.g., "#{[[...stuff...]]}"
) (edited)
This presents a problem if I want to then deserialize the result of a Lambda execution somewhere. Is that extra #{...}
wrapper Lambda the Ultimateās doing? Is there a way to āturn it offā?
(apologies if this is answered in the video above, which I havenāt gotten a chance to watch. Stupid linear time!)
The use case here is that I have an example almost completely done showing how to set up AppSync and Cognito to work with Ions and I want to show the difference between doing the transformation of data shape between GraphQL and Lambda in a net-new ion vs. in the AppSync resolver VTL template (tl; dr: do you want to use Velocity when you have Clojure ready to hand, for data transform? You do not!)
but the AppSync invocation of the items-by-type
Lambda chokes on the #{ ... }
@chris_johnson The answer is not immediately obvious to me, but the problem is almost certainly not in the Lambda. Why can't AppSync handle the set notation?
because itās not JSON
items-by-type does not return JSON
if you want it to do so, modify it to print JSON instead of printing edn
and then I hope you will be good to go! Are you going to publish the example?
Okay, that makes sense. I was hoping to be able to take just the raw edn string value and process it in VTL on the AppSync side, not because itās a thing youād want to do often but to demonstrate dropping AppSync āontoā an existing ion, but AppSync tries to deserialize it before handing it off
yeah, that gives me the information I need. I do already have an items-by-type-gql
which returns JSON but itās also doing the output data shaping.
any name with more than two hyphens is doing too much š
I-do-it-all-the-time-myself
I do intend to publish this example just as soon as I get these last couple bits polished up and finish finding or creating enough cool memes to put in the README
I will also go look again and see if thereās a way to make the AppSync resolver expect a raw string instead of something it can parse into JSON, which would be delightful.
once you are out in the broader AWS world you should probably be in JSON anyway š
I mean, they expose VTL for you to template the output! Why would they give you a possibly-Turing-complete tool for shaping the output data but insist on pushing it through JSON.readString
first? :thinking_face:
(Cross post from #clojure)
I have what I think is a backup of a datomic database. It is a directory with the contents ./data/db/datomic.h2.db
. Does this seem right? How do I translate that to a file:///home/...
url? I am getting a clojure.lang.ExceptionInfo: :restore/no-roots No restore points available at
error.
Can I (or have plans) to generate a "amazon event that triggers a lambda" on every transaction on datomicIons?
[(identity ?list) [[?e ?a "" _ true] ...]]
seems to match any value. You can't use literals in this way, can you?
My ion with API Gateway integration is responding with the body base64 encoded...what might I be doing incorrectly? :thinking_face:
@cjsauer in the API Gateway test UI, or as viewed from e.g. curl?
@stuarthalloway it's within the API Gateway UI, but I'm also seeing it happen within the Lambda console using a sample API Gateway event. My handler is returning a string in the response :body
field.
@cjsauer that is by design. You must make a gateway level choice about how to do this, and then Gateway will fix it on the way through
the only way to see it the way you want is to consume all the way from the outside edge, e.g. from your browser or curl
@stuarthalloway hm...even hitting it with curl returns a base64 encoded string. I'm testing at the REPL as well by doing (my-handler {:input (slurp "fixture.json")})
and am also seeing the encoding.
maybe you left out "Choose Add Binary Media Type, and add the */*
type, then Save Changes." from https://docs.datomic.com/cloud/ions/ions-tutorial.html#sec-5-3
I left that out about 100 times when testing it ^^
@stuarthalloway DOH...that was it!! Working now. Thank you! š»
I don't have any experience running applications that require HIPPA compliance. I'm curious if anyone has ran Datomic in such an environment and if it would be possible to store HIPPA protected data in Datomic Cloud.
has anyone successfully used figwheel main along with datomic cloud client? It seems there are some dependency issues on the version of jetty that each one requires. if I try to use the version of jetty that datomic cloud api requires (9.3.7.v2016011) then figwheel can't connect...looks like it gets an error trying to create the websocket. If I use the version figwheel main relies on which looks to be (9.2.21.v20170120) then of course datomic cloud api gets errors trying to connect.
jetty seems to be the one library that is constantly frustrating when it comes to dependency management in clojure
i'm looking at that now
well but i'm in dev mode working on my app that utilizes the datomic client api....that's the issue. Figured it out with Bruce's help in the figwheel-main channel. If anyone else comes across the issue you just need to exclude the websocket libs from figwheel main then add the version matching the jetty client (9.3) in your top level deps.