I have trouble setting up Datomic with Heroku Postgres. First of all I have this successfully installed
[com.datomic/datomic-pro "0.9.5206" :exclusions [joda-time]]
My sql-transactor.properties
file looks like this:
protocol=sql
host=localhost
port=4334
license-key=<MY_LICENSE_KEY>
sql-url=jdbc:postgresql://ec2-54-204-3-200.compute-1.amazonaws.com:5432/<MY_HEROKU_DB_NAME>
sql-user=<MY_USER>
sql-password=<MY_PASS>
sql-driver-params=ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory
When I try to run transactor from downloaded datomic-pro folder as:
bin/transactor /path/to/folder/sql-transactor.properties
It gives following output:
Launching with Java options -server -Xms1g -Xmx1g -XX:+UseG1GC -XX:MaxGCPauseMillis=50
Starting datomic:sql://<DB-NAME>?jdbc:postgresql://ec2-54-204-3-200.compute-1.amazonaws.com:5432/<MY_HEROKU_DB_NAME>?user=<MY_USER>&password=<MY_PASS>&ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory, you may need to change the user and password parameters to work with your jdbc driver ...
System started datomic:sql://<DB-NAME>?jdbc:postgresql://ec2-54-204-3-200.compute-1.amazonaws.com:5432/<MY_HEROKU_DB_NAME>?user=<MY_USER>&password=<MY_PASS>&ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory, you may need to change the user and password parameters to work with your jdbc driver
NOTE: The <DB-NAME>
in the output is literally <DB-NAME>
. It's not my placeholder. I think this might be a mistake.
Now when I try in clojure:
(def uri "datomic:sql://<MY_HEROKU_DB_NAME>?jdbc:postgresql://localhost:5432/<MY_HEROKU_DB_NAME>")
(def conn (datomic.api/connect uri))
It gives error:
java.net.ConnectException: Connection refused
org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
java.util.concurrent.ExecutionException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
clojure.lang.Compiler$CompilerException: java.util.concurrent.ExecutionException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections., compiling:(server.clj:40:11)
Anybody any ideas?
EDIT: I forgot to mention that I already did steps from http://docs.datomic.com/storage.html about bin/sql/postgres-table
script