Fork me on GitHub
#datomic
<
2019-06-12
>
Nolan01:06:42

Having trouble getting a Lambda-proxy Ion to respond with a non-base64-encoded body. Is there a way to force "isBase64Encoded": false? The ion returns a map:

{:body "<some transit>"
 :headers {"Content-Type" "application/transit+json", ...}
 :status 200}
But API Gateway logs show that the response body is base64 encoded prior to API Gateway’s response transformations. The request also includes {:headers {"Accept" "application/transit+json"}, ...}. Is this an API Gateway setting?

dmarjenburgh09:06:17

@nolan Yes, you can configure it in API Gateway. https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-payload-encodings-configure-with-console.html Easiest is to add */* as binary media type. API Gateway will base64 decode the response for you

🤝 4
🙏 4
wizard 4
octahedrion10:06:11

Is there a list of ways to optimize queries ? And if it's possible to apply functions to :where clauses to optimize them, could we make a library that automates the process ? Because ideally queries should be written for readability

dmarjenburgh13:06:44

There are some best-practices for getting the most out of queries https://docs.datomic.com/cloud/best.html#most-selective-clauses-first. I suppose the query engine could optimise the query for you, but AFAIK it doesn’t do such a thing atm

Lone Ranger12:06:04

does anyone happen to know what versions of MySQL and corresponding jdbc and mysql adapter are supported by latest datomic on prem??

favila14:06:32

datomic's use of sql is minimal. it's basically a key-value blob store

favila14:06:36

we use mysql 5.7 with connectorj 5.1.47 but have used other combinations in the past

favila14:06:19

I also got it running on sqlite once just for perf comparison with "dev" transactor (which uses h2)

Lone Ranger15:06:18

alright I'll give that a shot. So you have the connectorj in both the lib of your datomic installation and in your deps.edn/`project.clj`/`build.boot`?

Lone Ranger15:06:29

or just in the lib?

Lone Ranger15:06:39

also can I ask what version of datomic you were using? And which of com.datomic/datomic-pro and which version of com.datomic/client-pro?

Lone Ranger15:06:06

and which version of org.clojure/java.jdbc (if you are using that :P)

Lone Ranger14:06:20

Also is there any documentation on how/why AMQ is involved with Datomic? 😛 Because apparently if you're doing stuff on docker it becomes important

Lone Ranger14:06:42

Execution error (ActiveMQNotConnectedException) at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl/createSessionFactory (ServerLocatorImpl.java:799).
AMQ119007: Cannot connect to server(s). Tried with all available servers.

favila14:06:32

it's how peers and the transactor communicate

Lone Ranger15:06:14

okay for the "Datomic Pro Starter Edition" are we limited to one download of the transactor com.datomic/datomic-pro {:mvn/version "0.9.5786"} or something? Trying to deploy to a docker container and I'm getting a 401

Alex Miller (Clojure team)15:06:52

are your maven settings properly set up for authentication?

eoliphant15:06:21

Are cross-db joins working in the client api now? saw this is in the api doc, but still getting weird errors if i try it

The query list form is [:find ?var1 ?var2 ...
                          :with ?var3 ...
                          :in $src1 $src2 ...
                          :where clause1 clause2 ...]

Lone Ranger16:06:17

is the behavior of datomic.api/create-database to throw a Syntax error (NullPointerException) on a malformed db string?

Lone Ranger16:06:26

or does that indicate something else is going on?

ghadi16:06:34

need more info @goomba: what call did you make?

ghadi16:06:41

arguments

Lone Ranger16:06:50

(line 10 above corresponds with db.clj:36 in the stack trace)

Lone Ranger16:06:54

I can't tell if this has something to do with the dependencies in my deps.edn, if the connection string is malformed, if my transactor.properties is incorrect, or if I don't have the correct .jar file in the <datomic-install>/lib, or if it's something else entirely

Lone Ranger16:06:29

if it helps, I get this same error whether or not the transactor is running

Lone Ranger16:06:41

I'll be moving rest of comments regarding this to this thread

souenzzo17:06:49

it's a missing jdbc@mysql driver?

Lone Ranger18:06:48

Probably but missing from where? In the application?

souenzzo18:06:59

I'm just a datomic user that never used it with jdbc. But by the exception, but looks like that you need to add [mysql/mysql-connector-java "8.0.16"] to your deps

Lone Ranger18:06:08

It is, unfortunately 😕 I'm just racking my brain because this is such an opaque error message

Lone Ranger18:06:09

:deps      {
             org.clojure/clojure        {:mvn/version "1.10.0"}
             datascript                 {:mvn/version "0.18.2"}
             org.clojure/data.codec     {:mvn/version "0.1.1"}
             compojure                  {:mvn/version "1.6.1"}
             http-kit                   {:mvn/version "2.3.0"}
             ring-cors                  {:mvn/version "0.1.13"}
             vvvvalvalval/supdate       {:mvn/version "0.2.3"}
             org.clojure/core.match     {:mvn/version "0.3.0"}
             com.novemberain/langohr    {:mvn/version "5.1.0"}
             com.novemberain/monger     {:mvn/version "3.1.0"}
             tempfile                   #:mvn{:version "0.2.0"}
             org.clojure/data.csv       {:mvn/version "0.1.4"}
             org.clojure/java.jdbc      {:mvn/version "0.7.9"}
             com.datomic/client-pro     {:mvn/version "0.8.28"}
             com.datomic/datomic-pro    {:mvn/version "0.9.5786"}
mysql/mysql-connector-java {:mvn/version "8.0.16"}
             com.taoensso/sente         {:mvn/version "1.14.0-RC2"}
             buddy                      {:mvn/version "2.0.0"}
             clj-http                   {:mvn/version "3.9.1"}
             org.clojure/tools.logging  {:mvn/version "0.4.1"}
             redis-async                {:local/root "../redis-async"}
             clj-jedis                  {:local/root "../clj-jedis"}}
             }

Lone Ranger18:06:48

All I can figure out is "something" is wrong

Lone Ranger19:06:37

good lord... finally got it .... conflicting dependencies oy ...

Lone Ranger19:06:52

apparently another library was pulling in datomic-free

daniel.spaniel20:06:52

? are transaction function supported in datomic-free ? i have not been able to get them to work ( someone mentioned 2 years about about there not being a transactor in the free version ) but this seems tough on people using free version .. though maybe that is the point

johnj20:06:44

FWIW, the CHANGES.md file inside datomic-free-0.9.5703.zip says classpath functions where added but I haven't try them

johnj20:06:30

How I would modify (d/pull db '[{:a [:b :c]}] eid]) to return {:b value :c value} instead of {:a {:b value :c value}} ?

daniel.spaniel20:06:02

i have tried to load datomic-free-0.9.5703 from deps.edn and it cant be found .. sadly

daniel.spaniel20:06:18

but that is good pointer @lockdown-

daniel.spaniel20:06:22

i will check that

daniel.spaniel20:06:08

interesting discussion that is super confusing

johnj21:06:18

yeah, why would 5703 free include that changelog then no idea

daniel.spaniel21:06:12

puzzler ( but it probably was mistake ( because it refers to on-prem ) still .. a puzzler non the less

johnj21:06:23

yes, that version is not in clojars but you can use the maven-install script that is inside the zip

daniel.spaniel21:06:51

interesting .. and kind of odd also

johnj21:06:07

well, looks like they are targeting the enterprise only and want their existing/new users to move to the cloud version

daniel.spaniel21:06:56

that figures, but we using free only for testing ( and using cloud version for real ) so this kill the buzz for testing a bit and for working on laptop while on bus and that sort of thing ( with no wifi )

ghadi21:06:08

you probably know already but free & cloud are not drop in replacements

johnj21:06:40

and neither its pro

ghadi21:06:20

free/pro are

ghadi21:06:41

on-prem == #{free pro} . vs cloud

ghadi21:06:17

syntax is different on some schema and tx -related things

johnj21:06:28

yeah, I mean pro and cloud are not compatible

daniel.spaniel21:06:10

we using this library to bridge that gap ( since we using cloud api for real ) https://github.com/ComputeSoftware/datomic-client-memdb.git

daniel.spaniel21:06:36

with this you can do mem-db ( with free ) and use same api as cloud ( BUUUUUT .. no transactions ) what a party pooper that was