 (defn- connection-details->spec [_ details]
   (-> details crate-spec))
 
+(defn- can-connect [driver details]
+  (let [connection (connection-details->spec driver details)]
+    (= 1 (-> (k/exec-raw connection "select 1 from sys.cluster" :results)
+             first
+             vals
+             first))))
+
 (def CrateISQLDriverMixin
-  "Implementations of `ISQLDriver` methods for `PostgresDriver`."
+  "Implementations of `ISQLDriver` methods for `CrateDriver`."
   (merge (sql/ISQLDriverDefaultsMixin)
          {:connection-details->spec  connection-details->spec}))
 

                                        :display-name "Port"
                                        :type         :integer
                                        :default      4300}])
          })
  sql/ISQLDriver CrateISQLDriverMixin)

(driver/register-driver! :crate (CrateDriver.))

(ns metabase.driver.crate
  (:require [metabase.driver :as driver]
            [metabase.driver.generic-sql :as sql]
            (korma [core :as k]))
  (:import (clojure.lang Named)))

(defrecord CrateDriver []
