Skip to content
Snippets Groups Projects
Commit 624668fd authored by Cam Saül's avatar Cam Saül
Browse files

Remove unused :make-pool? option [ci drivers]

parent fdcd42ab
No related branches found
No related tags found
No related merge requests found
......@@ -370,9 +370,8 @@
(io/delete-file (str filename ".mv.db") :silently)
(io/delete-file (str filename ".trace.db") :silently)
(println "Creating db...")
(let [db (dbspec/h2 {:db (format "file:%s;UNDO_LOG=0;CACHE_SIZE=131072;QUERY_CACHE_SIZE=128;COMPRESS=TRUE;MULTI_THREADED=TRUE;MVCC=TRUE;DEFRAG_ALWAYS=TRUE;MAX_COMPACT_TIME=5000;ANALYZE_AUTO=100"
filename)
:make-pool? false})]
(let [db (dbspec/h2 {:db (format "file:%s;UNDO_LOG=0;CACHE_SIZE=131072;QUERY_CACHE_SIZE=128;COMPRESS=TRUE;MULTI_THREADED=TRUE;MVCC=TRUE;DEFRAG_ALWAYS=TRUE;MAX_COMPACT_TIME=5000;ANALYZE_AUTO=100"
filename)})]
(doseq [[table-name field->type] (seq tables)]
(jdbc/execute! db [(create-table-sql table-name field->type)]))
......
......@@ -265,7 +265,7 @@
(.setTestConnectionOnCheckout false)
(.setPreferredTestQuery nil)
(.setProperties (u/prog1 (java.util.Properties.)
(doseq [[k v] (dissoc spec :make-pool? :classname :subprotocol :subname :naming :delimiters :alias-delimiter
(doseq [[k v] (dissoc spec :classname :subprotocol :subname :naming :delimiters :alias-delimiter
:excess-timeout :minimum-pool-size :idle-connection-test-period)]
(.setProperty <> (name k) (str v))))))})
......
......@@ -4,40 +4,37 @@
(defn h2
"Create a database specification for a h2 database. Opts should include a key
for :db which is the path to the database file."
[{:keys [db make-pool?]
:or {db "h2.db", make-pool? true}
[{:keys [db]
:or {db "h2.db"}
:as opts}]
(merge {:classname "org.h2.Driver" ; must be in classpath
:subprotocol "h2"
:subname db
:make-pool? make-pool?}
:subname db}
(dissoc opts :db)))
(defn postgres
"Create a database specification for a postgres database. Opts should include
keys for :db, :user, and :password. You can also optionally set host and
port."
[{:keys [host port db make-pool?]
:or {host "localhost", port 5432, db "", make-pool? true}
[{:keys [host port db]
:or {host "localhost", port 5432, db ""}
:as opts}]
(merge {:classname "org.postgresql.Driver" ; must be in classpath
:subprotocol "postgresql"
:subname (str "//" host ":" port "/" db)
:make-pool? make-pool?}
:subname (str "//" host ":" port "/" db)}
(dissoc opts :host :port :db)))
(defn mysql
"Create a database specification for a mysql database. Opts should include keys
for :db, :user, and :password. You can also optionally set host and port.
Delimiters are automatically set to \"`\"."
[{:keys [host port db make-pool?]
:or {host "localhost", port 3306, db "", make-pool? true}
[{:keys [host port db]
:or {host "localhost", port 3306, db ""}
:as opts}]
(merge {:classname "com.mysql.jdbc.Driver" ; must be in classpath
:subprotocol "mysql"
:subname (str "//" host ":" port "/" db)
:delimiters "`"
:make-pool? make-pool?}
:delimiters "`"}
(dissoc opts :host :port :db)))
......@@ -46,25 +43,23 @@
(defn mssql
"Create a database specification for a mssql database. Opts should include keys
for :db, :user, and :password. You can also optionally set host and port."
[{:keys [user password db host port make-pool?]
:or {user "dbuser", password "dbpassword", db "", host "localhost", port 1433, make-pool? true}
[{:keys [user password db host port]
:or {user "dbuser", password "dbpassword", db "", host "localhost", port 1433}
:as opts}]
(merge {:classname "com.microsoft.sqlserver.jdbc.SQLServerDriver" ; must be in classpath
:subprotocol "sqlserver"
:subname (str "//" host ":" port ";database=" db ";user=" user ";password=" password)
:make-pool? make-pool?}
:subname (str "//" host ":" port ";database=" db ";user=" user ";password=" password)}
(dissoc opts :host :port :db)))
(defn sqlite3
"Create a database specification for a SQLite3 database. Opts should include a
key for :db which is the path to the database file."
[{:keys [db make-pool?]
:or {db "sqlite.db", make-pool? true}
[{:keys [db]
:or {db "sqlite.db"}
:as opts}]
(merge {:classname "org.sqlite.JDBC" ; must be in classpath
:subprotocol "sqlite"
:subname db
:make-pool? make-pool?}
:subname db}
(dissoc opts :db)))
(defn oracle
......
......@@ -32,7 +32,7 @@
(keyword "Long Varchar") :type/Text
(keyword "Long Varbinary") :type/*})
(defn- vertica-spec [{:keys [host port db make-pool?]
(defn- vertica-spec [{:keys [host port db]
:or {host "localhost", port 5433, db ""}
:as opts}]
(merge {:classname "com.vertica.jdbc.Driver"
......
......@@ -25,7 +25,6 @@
:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5432/bird_sightings"
:make-pool? true
:sslmode "disable"}
(sql/connection-details->spec pg-driver {:ssl false
:host "localhost"
......@@ -36,7 +35,6 @@
;; ## ssl - check that expected params get added
(expect
{:ssl true
:make-pool? true
:sslmode "require"
:classname "org.postgresql.Driver"
:subprotocol "postgresql"
......
......@@ -152,8 +152,7 @@
(quote+combine-names driver (qualified-name-components driver db-name table-name field-name))))
(defn- default-database->spec [driver context dbdef]
(let [spec (sql/connection-details->spec driver (i/database->connection-details driver context dbdef))]
(assoc spec :make-pool? true)))
(sql/connection-details->spec driver (i/database->connection-details driver context dbdef)))
;;; Loading Table Data
......
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