           :create-db-sql             (constantly nil)
           :add-fk-sql                (constantly nil)
           :drop-db-if-exists-sql     (constantly nil)
-          :load-data!                (make-load-data-fn)})
+          :load-data!                (make-load-data-fn generic/load-data-add-ids)})
   i/IDatasetLoader
   (merge generic/IDatasetLoaderMixin
          {:database->connection-details database->connection-details

   :TextField       "string"
   :TimeField       "timestamp"})

(defn- escape-field-names
  "Escape the field-name keys in ROW-OR-ROWS."
  [row-or-rows]
  (if (sequential? row-or-rows)
    (map escape-field-names row-or-rows)
    (into {} (for [[k v] row-or-rows]
               {(sql/escape-field-name k) v}))))

(defn- make-load-data-fn
  "Create a `load-data!` function. This creates a function to actually insert a row or rows, wraps it with any WRAP-INSERT-FNS,
   the calls the resulting function with the rows to insert."
  [& wrap-insert-fns]
  (fn [driver dbdef tabledef]
    (let [insert! (fn [row-or-rows]
                    (apply jdbc/insert!
                           (generic/database->spec driver :db dbdef)
                           (keyword (get tabledef :table-name))
                           :transaction? false
                           (escape-field-names row-or-rows)))
          rows      (apply list (generic/load-data-get-rows driver dbdef tabledef))]
      (insert! rows))))


            (metabase.test.data [generic-sql :as generic]
                                [interface :as i])
            [metabase.driver.generic-sql :as sql]
            [clojure.java.jdbc :as jdbc]
            [metabase.util :as u])
  (:import metabase.driver.crate.CrateDriver))

(def ^:private ^:const field-base-type->sql-type
