From 61674405009de079870fdc0ff30d892b7a82ad53 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sat, 6 Jun 2020 17:16:17 -0700 Subject: [PATCH] jTDS support; PostgreSQL 12.2.0 support --- CHANGELOG.md | 5 +++++ test/next/jdbc/test_fixtures.clj | 12 +++++++++--- test/next/jdbc_test.clj | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40798f9..d87b06b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ Only accretive/fixative changes will be made from now on. +Changes made on master since 1.0.462: +* Add tests for `"jtds"` database driver (against MS SQL Server), making it officially supported. +* Switch from OpenTable Embedded PostgreSQL to Zonky's version, so that testing can move forward from PostgreSQL 10.11 to 12.2.0. +* Add log4j2 as a test dependency so that I have better control over logging (which makes debugging easier!). + ## Stable Builds * 2020-05-31 -- 1.0.462 diff --git a/test/next/jdbc/test_fixtures.clj b/test/next/jdbc/test_fixtures.clj index ee25b9e..9b3da86 100644 --- a/test/next/jdbc/test_fixtures.clj +++ b/test/next/jdbc/test_fixtures.clj @@ -5,7 +5,7 @@ (:require [clojure.string :as str] [next.jdbc :as jdbc] [next.jdbc.sql :as sql]) - (:import (com.opentable.db.postgres.embedded EmbeddedPostgres))) + (:import (io.zonky.test.db.postgres.embedded EmbeddedPostgres))) (set! *warn-on-reflection* true) @@ -39,10 +39,16 @@ (def ^:private test-mssql (when (System/getenv "NEXT_JDBC_TEST_MSSQL") test-mssql-map)) +(def ^:private test-jtds-map + {:dbtype "jtds" :dbname "model" + :user "sa" :password (System/getenv "MSSQL_SA_PASSWORD")}) +(def ^:private test-jtds + (when (System/getenv "NEXT_JDBC_TEST_MSSQL") test-jtds-map)) + (def ^:private test-db-specs (cond-> [test-derby test-h2-mem test-h2 test-hsql test-sqlite test-postgres] test-mysql (conj test-mysql) - test-mssql (conj test-mssql))) + test-mssql (conj test-mssql test-jtds))) (def ^:private test-db-spec (atom nil)) @@ -52,7 +58,7 @@ (defn maria? [] (= "mariadb" (:dbtype @test-db-spec))) -(defn mssql? [] (= "mssql" (:dbtype @test-db-spec))) +(defn mssql? [] (#{"jtds" "mssql"} (:dbtype @test-db-spec))) (defn mysql? [] (#{"mariadb" "mysql"} (:dbtype @test-db-spec))) diff --git a/test/next/jdbc_test.clj b/test/next/jdbc_test.clj index 5fb5ecd..db82825 100644 --- a/test/next/jdbc_test.clj +++ b/test/next/jdbc_test.clj @@ -303,7 +303,7 @@ VALUES ('Pear', 'green', 49, 47) (is (instance? javax.sql.DataSource ds)) (is (str/index-of (pr-str ds) (str "jdbc:" (cond (jtds?) - "jtds:server" + "jtds:sqlserver" (mssql?) "sqlserver" :else