Fork me on GitHub

hi, what these 3 dots mean :find [?e ...] ?


so it returns a collection?


I only see collection binding...


there are four different bindings, all explained here: 🙂

👍 4
Marcus Vieira14:09:49

hi everyone, I’m trying to use datomic for an example project I have and I’m running into some issues — here’s everything I did so far: 1. Registered for an account 2. Downloaded datomic-pro 3. Created a and updated it with the license-key I received on my email 4. Ran bin/transactor 5. Opened another tab, and created a database:

(require '[datomic.api :as d])
(def db-uri "datomic:)
(d/create-database db-uri)
6. Started a peer server on another tab
bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d hello,datomic:
7. Added [com.datomic/client-pro "0.8.28"] to my dependencies 8. When running lein ring server I am getting this error:
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.util.thread.NonBlockingThread


can you share the stacktrace? if you do lein repl then (d/connect ".. your db uri ..") you get the same error?

Marcus Vieira16:09:40

when running the commands I get:

> (def client (d/client cfg))
Syntax error (ClassNotFoundException) compiling . at (http_client.clj:89:19).


*e on repl will show the full exception


but it should be some dependenciy conflict with http libs please dump a lein deps :tree here

Marcus Vieira17:09:29

[clojure-complete "0.2.5" :exclusions [[org.clojure/clojure]]]
 [com.datomic/client-pro "0.9.37"]
   [com.cognitect/anomalies "0.1.12"]
   [com.datomic/client-api "0.8.35"]
   [com.datomic/client-impl-shared "0.8.67"]
     [com.cognitect/hmac-authn "0.1.195"]
     [com.cognitect/transit-clj "0.8.313"]
       [com.cognitect/transit-java "0.8.337"]
         [javax.xml.bind/jaxb-api "2.3.0"]
         [org.msgpack/msgpack "0.6.12"]
           [com.googlecode.json-simple/json-simple "1.1.1" :exclusions [[junit]]]
           [org.javassist/javassist "3.18.1-GA"]
   [com.datomic/client "0.8.81"]
     [com.cognitect/http-client "0.1.99"]
       [org.eclipse.jetty/jetty-client "9.4.15.v20190215"]
         [org.eclipse.jetty/jetty-io "9.4.15.v20190215"]
       [org.eclipse.jetty/jetty-http "9.4.15.v20190215"]
       [org.eclipse.jetty/jetty-util "9.4.15.v20190215"]
     [com.datomic/query-support "0.8.16"]
   [org.clojure/core.async "0.3.442"]
     [org.clojure/tools.analyzer.jvm "0.7.0"]
       [org.clojure/core.memoize "0.5.9"]
         [org.clojure/core.cache "0.6.5"]
           [org.clojure/data.priority-map "0.0.7"]
       [org.clojure/tools.analyzer "0.6.9"]
       [org.clojure/tools.reader "1.0.0-beta4"]
       [org.ow2.asm/asm-all "4.2"]
 [compojure "1.6.1"]
   [clout "2.2.1"]
     [instaparse "1.4.8" :exclusions [[org.clojure/clojure]]]
   [medley "1.0.0"]
   [org.clojure/tools.macro "0.1.5"]
   [ring/ring-codec "1.1.0"]
     [commons-codec "1.10"]
   [ring/ring-core "1.6.3"]
     [clj-time "0.11.0"]
       [joda-time "2.8.2"]
     [commons-fileupload "1.3.3"]
     [commons-io "2.5"]
     [crypto-equality "1.0.0"]
     [crypto-random "1.2.0"]
 [javax.servlet/servlet-api "2.5" :scope "test"]
 [nrepl "0.6.0" :exclusions [[org.clojure/clojure]]]
 [org.clojure/clojure "1.10.0"]
   [org.clojure/core.specs.alpha "0.2.44"]
   [org.clojure/spec.alpha "0.2.176"]
 [org.clojure/data.json "0.2.6"]
 [ring/ring-defaults "0.3.2"]
   [javax.servlet/javax.servlet-api "3.1.0"]
   [ring/ring-anti-forgery "1.3.0"]
     [hiccup "1.0.5"]
   [ring/ring-headers "0.3.0"]
   [ring/ring-ssl "0.3.0"]
 [ring/ring-mock "0.3.2" :scope "test"]
   [cheshire "5.8.0" :scope "test"]
     [com.fasterxml.jackson.core/jackson-core "2.9.0"]
     [com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.9.0" :scope "test"]
     [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.9.0" :scope "test"]
     [tigris "0.1.1" :scope "test"]

Marcus Vieira17:09:48

and here are my dependencies:

:dependencies [[org.clojure/clojure "1.10.0"]
                 [compojure "1.6.1"]
                 [org.clojure/data.json "0.2.6"]
                 [ring/ring-defaults "0.3.2"]
                 [com.datomic/client-pro "0.9.37"]]
  :plugins [[lein-ring "0.12.5"]]


is there a SQL injection analogy like Datalog injection ?


[:find ?e
  :where [(clojure.core/eval "(prn :ok)")]]


I'm really struggling to get my AWS ECS service to connect to datomic cloud via a VPC endpoint. I appreciate that there are a whole bunch of areas where the connection could fail but does anyone have some war stories/gotchas related to using VPC endpoints to share that might shed some light? A few bits of info: * Datomic cloud is deployed via AWS marketplace to the same AWS account on the it's recommended VPC (i.e. * Everything (Datomic, ECS service et al) is running in the same AWS region. * Bastion is running - and I can connect locally to Datomic via Bastion succcessfully. * My ECS service is running in a separate VPC. * A VPC endpoint and corresponding endpoint service has been added as described here * The security group for the endpoint has deliberately been set very open whilst I get to the bottom of this (i.e. ingress: allow all TCP traffic from anywhere; egress: allow everything to everywhere) * I've tried an endpoint without a principal whitelist and with a principal whitelist of * - no difference. There's nothing special about the client config (I think); essentially this:

{:server-type :cloud
  :region      "<my-region>"
  :system      "<my-system>"
  :endpoint    "http://<endpoint-dns>:8182"
  :proxy-port  8182}
The error I'm getting is a simple Connection refused. Any thoughts gratefully appreciated!


I have no experience with Datomic but did you try to ssh into the ecs instance and check logs; or possibly try to connect from the shell?


Yeah I did try all that thanks.


I have got it working now though and I'll note down the key things I changed to make it work in a little while.


I had a couple of problems: one related to putting my VPC endpoint in the wrong subnet of my VPC and the other was that the IAM role under which the ECS service runs requires read privileges to the Datomic S3 bucket.