|
|
@ -50,9 +50,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
(defn- fix-uri [uri]
|
|
|
|
(defn- fix-uri [uri]
|
|
|
|
(when uri
|
|
|
|
(when uri
|
|
|
|
(if (str/starts-with? uri "jdbc:")
|
|
|
|
(let [[_ user _ pass] (re-find #"://([^:@]+)(:([^@]+))?@" uri)]
|
|
|
|
uri
|
|
|
|
(cond-> uri
|
|
|
|
(str "jdbc:" uri))))
|
|
|
|
(not (str/starts-with? uri "jdbc:")) (->> (str "jdbc:"))
|
|
|
|
|
|
|
|
(str/includes? uri "@") (str/replace #"://[^@]+@" "://")
|
|
|
|
|
|
|
|
user (str "?user=" user)
|
|
|
|
|
|
|
|
pass (str "&password=" pass)))))
|
|
|
|
|
|
|
|
|
|
|
|
(defn hikaricp [opts]
|
|
|
|
(defn hikaricp [opts]
|
|
|
|
(let [opts (update opts :uri fix-uri)]
|
|
|
|
(let [opts (update opts :uri fix-uri)]
|
|
|
|