I am parsing postgresql uri in configuration settings on Heroku. But I canโt make it work. Any help would be greatly appreciated, I will probably miss something direct.
The code is used here.
(def dev-db-info {:db "dbname" :user "username"}) (defn parse-db-uri [uri] (drop 1 (split uri #"://|:|@|/"))) (defn create-map-from-uri [uri] (let [parsed (parse-db-uri uri)] (zipmap [:user :password :host :port :db] parsed))) (defn db-info [] (if production? (create-map-from-uri (System/getenv "DATABASE_URL")) dev-db-info)) (defdb connected-db (postgres (db-info)))
The map I am retrieving from uri is as follows:
{:db "dbname" :port "5662" :host "ec2-url.compute-1.amazonaws.com" :password "pwd" :user "username"}
I get the following error:
Connections could not be acquired from the underlying database!
EDIT:
Since then I have refused to use Korma and switched to using Clojure.JDBC 0.2.3, which supports "connection-uri" and, therefore, ssl connections to db. Feed currently does not support this. I will post a problem on Github to resolve this connection method.
postgresql clojure heroku korma
conorwade
source share