Fork me on GitHub
#rethinkdb
<
2016-10-02
>
jeremykirkham08:10:03

Hi guys, first time on clojurians slack - bit of a beginner. I'm setting up a http://compose.io rethinkdb deployment and I want to use https://github.com/apa512/clj-rethinkdb to connect to it, but don't know which connection parameters I should be using

apa51214:10:11

Probably host and auth-key

jeremykirkham22:10:41

So here's my connection snippit:

`
(defn rethink-connect
  []
  (r/connect  :host     (environ.core/env :rethinkdb-host)
              :port     (environ.core/env :rethinkdb-port)
              :db       (environ.core/env :rethinkdb-db)
              :auth-key (environ.core/env :rethinkdb-auth)))

(defn record-event!
  [event collection]
  (let [r  (with-open [conn (rethink-connect)]
              (-> (r/table collection)
                  (r/insert [event])
                  (r/run conn)))]))

` But I keep getting the error:
`
clojure.lang.ExceptionInfo: Error connecting to RethinkDB database
` I'm getting the host, port, db and auth-key from my http://compose.io rethinkdb instance. The auth-key is the admin password taken from authentication credential provided by http://compose.io interface. Not sure what's going on. I'm also given a connection string which I was wondering if I could use instead of each parameter - looks like `` <rethinkdb://admin:[password]@aws-us-xxx-1-portal.xxx.xxxx.com:15731>