Closed lucassousaf closed 1 year ago
That sounds fine to me.
A status update on this issue. We already have the implementation however we had a problem while writing the tests for our changes. hikari-cp
library had a bug when trying to use the adapter
option for SQLite
. We recently did a pull request, it got merged and we are waiting for a new release with our changes applied. Once that is done we'll make PR to this repository.
Just let you know in advance here is the part that changed in order to accomplish what we described in this issue: https://github.com/gethop-dev/database.sql.hikaricp/commit/e7f3015859fe36e5b4a9334441c041838adec6d0
Once we do the PR we'll give more details about the change in the commit message.
What do you think?
That seems fine, too. Thanks for your work on this.
We just created the associatd PR: #15
As the README states:
Those HikariCP configuration options allow us to specify the connection details by supplying the individual options:
adapter
server-name
port-number
username
password
database-name
instead of a single
jdbc-url
orconnection-uri
. Butdatabase.sql.hikaricp
assumes that there will always be ajdbc-url
orconnection-uri
option provided. And unconditionally sets thejdbc-url
option in the map passed tohikari-cp/make-datasource
.Because
hikari-cp/make-datasource
checks the validity of thejdbc-url
option (and throws an exception if it doesn't like it), that means that even if we provide individual options that are valid and sufficient to create the datasource, we will still need to provide a fake (but still valid-looking)jdbc-url
orconnection-uri
. Even if that fakejdbc-url
/connection-uri
is completely ignored byhikari-cp/make-datasource
in this case.So we propose to make
jdbc-url
/connection-uri
completely optional. And we would be glad to provide a pull request for that change.