korma / Korma

Tasty SQL for Clojure.
http://sqlkorma.com
1.48k stars 222 forks source link

:connection-uri with user and password qs times out #368

Open danielzurawski opened 7 years ago

danielzurawski commented 7 years ago

Hello, Using the 0.4.3 version of KormaSQL I am unable to configure it to connect to a database that requires user credentials using the following query string:

jdbc:postgresql://172.16.100.2:12001/dbname?user=dbuser&password=password

Using the same connection-uri, I seem to be able to connect just fine using HugSQL (which uses Hikari instead of c3p0 pooling lib like Korma does). Is this something that would need to be added to Korma or is there problem elsewhere?

Thanks!

danielzurawski commented 7 years ago

Furthermore, passing the :user and :password in the config object to (postgres ) does not work, the connection still times out. The work around for now seems to be not to use the connection-uri and pass all (port host, db, user, password) in the object.

Edit: using another jdbc format: "jdbc:postgresql://dbuser:password@172.16.100.2:12001/dbname" also times out (which also works in the other library)

immoh commented 7 years ago

Looking at code for 0.4.3, I don't see any support for connection uri. Can you post code examples how you have tried?

Support for connection uri has been implemented in commit 527565de9eb44a64a5ed88f77f3a97122d0a35db (not released yet) and I believe it should support user and password in uri as well. However, I am not 100% as there are no tests for this and I haven't tried myself.

venantius commented 6 years ago

This will probably be resolved when 0.4.4 is released. I'll give it a milestone tag and we can close when that ships.