                   {:special-type calculated-special-type})))))
 
 (defn- add-table-pks
-  [metadata table]
+  [^DatabaseMetaData metadata, table]
   (let [pks (->> (.getPrimaryKeys metadata nil nil (:name table))
                  jdbc/result-set-seq
                  (mapv :column_name)

   Fetch list of schemas, then for each one not in `excluded-schemas`, fetch its Tables, and combine the results.

   This is as much as 15x faster for Databases with lots of system tables than `post-filtered-active-tables` (4 seconds vs 60)."
  [driver metadata]
  (let [all-schemas (set (map :table_schem (jdbc/result-set-seq (.getSchemas metadata))))
        schemas     (set/difference all-schemas (excluded-schemas driver))]
    (set (for [schema     schemas

            [metabase.util :as u]
            [metabase.util.korma-extensions :as kx]
            [metabase.driver.sync :as sync])
  (:import java.sql.DatabaseMetaData
           java.util.Map
           clojure.lang.Keyword))

(declare db->korma-db
