Skip to content
Snippets Groups Projects
Unverified Commit 38b22bcb authored by Cam Saul's avatar Cam Saul
Browse files

Allow additional connection options for Vertica

parent 9c3be9ca
No related branches found
No related tags found
No related merge requests found
......@@ -36,10 +36,11 @@
(defn- connection-details->spec [{:keys [host port db dbname]
:or {host "localhost", port 5433, db ""}
:as details}]
(merge {:classname "com.vertica.jdbc.Driver"
:subprotocol "vertica"
:subname (str "//" host ":" port "/" (or dbname db))}
(dissoc details :host :port :dbname :db :ssl)))
(-> (merge {:classname "com.vertica.jdbc.Driver"
:subprotocol "vertica"
:subname (str "//" host ":" port "/" (or dbname db))}
(dissoc details :host :port :dbname :db :ssl))
(sql/handle-additional-options details)))
(defn- unix-timestamp->timestamp [expr seconds-or-milliseconds]
(case seconds-or-milliseconds
......@@ -136,7 +137,10 @@
{:name "password"
:display-name "Database password"
:type :password
:placeholder "*******"}]))
:placeholder "*******"}
{:name "additional-options"
:display-name "Additional JDBC connection string options"
:placeholder "ConnectionLoadBalance=1"}]))
:current-db-time (driver/make-current-db-time-fn vertica-date-formatter vertica-db-time-query)})
sql/ISQLDriver
(merge (sql/ISQLDriverDefaultsMixin)
......
(ns metabase.driver.vertica-test
(:require [metabase.test.data.datasets :refer [expect-with-engine]]
(:require [expectations :refer [expect]]
[metabase.driver.vertica :as vertica]
[metabase.test.data.datasets :refer [expect-with-engine]]
[metabase.test.util :as tu]))
(expect-with-engine :vertica
"UTC"
(tu/db-timezone-id))
;; make sure you can add additional connection string options (#6651)
(expect
{:classname "com.vertica.jdbc.Driver"
:subprotocol "vertica"
:subname "//localhost:5433/birds-near-me?ConnectionLoadBalance=1"}
(#'vertica/connection-details->spec {:host "localhost"
:port 5433
:db "birds-near-me"
:additional-options "ConnectionLoadBalance=1"}))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment