From 3c50e801bf56c58cabdafbabe541409c27bad9bb Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Fri, 11 Sep 2020 20:49:14 -0700 Subject: [PATCH] Add -X function to create the MySQL DB --- test/next/jdbc/test_fixtures.clj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/next/jdbc/test_fixtures.clj b/test/next/jdbc/test_fixtures.clj index 8cea90f..bc004b0 100644 --- a/test/next/jdbc/test_fixtures.clj +++ b/test/next/jdbc/test_fixtures.clj @@ -36,6 +36,14 @@ (def ^:private test-mysql (when (System/getenv "NEXT_JDBC_TEST_MYSQL") test-mysql-map)) +(defn create-clojure-test [_] + (when test-mysql + (let [mysql (assoc test-mysql :dbname "mysql")] + (println "Creating clojure-test database in MySQL...") + (jdbc/execute-one! mysql ["create database if not exists clojure_test"]) + (println "...done!") + (shutdown-agents)))) + (def ^:private test-mssql-map {:dbtype "mssql" :dbname "model" :user "sa" :password (System/getenv "MSSQL_SA_PASSWORD")})