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

Breakout other non-Snowflake minor tweaks from Snowflake PR [ci drivers]

parent 83e821bf
No related merge requests found
......@@ -82,7 +82,7 @@
com.sun.jmx/jmxri]]
[medley "0.8.4"] ; lightweight lib of useful functions
[metabase/throttle "1.0.1"] ; Tools for throttling access to API endpoints and other code pathways
[mysql/mysql-connector-java "5.1.45"] ; !!! Don't upgrade to 6.0+ yet -- that's Java 8 only !!!
[mysql/mysql-connector-java "5.1.45"] ; !!! Don't upgrade to 6.0+ yet -- that's Java 8 only !!!
[jdistlib "0.5.1" ; Distribution statistic tests
:exclusions [com.github.wendykierp/JTransforms]]
[net.sf.cssbox/cssbox "4.12" ; HTML / CSS rendering
......
......@@ -10,7 +10,6 @@
[clojure.tools.logging :as log]
[metabase.driver.druid.js :as js]
[metabase.mbql.util :as mbql.u]
[metabase.models.database :refer [Database]]
[metabase.query-processor
[interface :as i]
[store :as qp.store]]
......@@ -18,8 +17,7 @@
[metabase.util :as u]
[metabase.util
[date :as du]
[i18n :as ui18n :refer [tru]]]
[toucan.db :as db])
[i18n :as ui18n :refer [tru]]])
(:import java.util.TimeZone
org.joda.time.DateTimeZone))
......@@ -1034,7 +1032,7 @@
middleware :middleware
:as query-context}]
{:pre [query]}
(let [details (db/select-one-field :details Database :id (u/get-id database-id))
(let [details (:details (qp.store/database))
query (if (string? query)
(json/parse-string query keyword)
query)
......
......@@ -175,7 +175,7 @@
(let [date-str (du/format-date :date-hour-minute-second-ms date)]
(sql/make-stmt-subs (-> (create-hsql-for-date date date-str)
hx/->date
(hsql/format :quoting (sql/quote-style (MySQLDriver.)))
(hsql/format :quoting :mysql, :allow-dashed-names? true)
first)
[date-str])))
......
......@@ -295,7 +295,7 @@
;; java.lang.IllegalArgumentException: No implementation of method: :database->connection-details
;; of protocol: IDriverTestExtensions found for class: metabase.driver.h2.H2Driver
;; to fix this we just need to reload a couple namespaces and then try again
(catch IllegalArgumentException _
(catch Exception _
(reload-test-extensions engine)
(get-or-create!))))))
......
......@@ -361,10 +361,10 @@
(when (seq statement)
(execute! driver context dbdef (s/replace statement #"⅋" ";"))))))
(defn- create-db!
(defn default-create-db!
"Default implementation of `create-db!` for SQL drivers."
([driver db-def]
(create-db! driver db-def nil))
(default-create-db! driver db-def nil))
([driver {:keys [table-definitions], :as dbdef} {:keys [skip-drop-db?]
:or {skip-drop-db? false}}]
(when-not skip-drop-db?
......@@ -403,7 +403,7 @@
(def IDriverTestExtensionsMixin
"Mixin for `IGenericSQLTestExtensions` types to implement `create-db!` from `IDriverTestExtensions`."
(merge i/IDriverTestExtensionsDefaultsMixin
{:create-db! create-db!}))
{:create-db! default-create-db!}))
;;; ## Various Util Fns
......
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