           (assert (every? map? (:cols <>)))
           (assert (sequential? (:columns <>)))
           (assert (every? u/string-or-keyword? (:columns <>))))))))
+
+
+(defn- run-query
+  "The end of the QP middleware processing which actually executes the query on the driver."
+  [query]
+  (let [driver       (:driver query)
+        native-form  (if-not (mbql-query? query)
+                       (get-in query [:native :query])
+                       (driver/mbql->native driver query))
+        native-query (if-not (mbql-query? query)
+                       query
+                       {:database (get-in query [:database :id])
+                        :type     :native
+                        :native   {:query native-form}})
+        raw-result   (driver/process-native driver native-query)
+        query-result (annotate/annotate query raw-result)]
+    (assoc query-result :native_form native-form)))
 
 
 ;;; +-------------------------------------------------------------------------------------------------------+

              cumulative-count
              limit
              post-check-results-format
              post-annotate
              pre-log-query
              guard-multiple-calls
              driver-process-query) (assoc query :driver driver))))))


;;; +----------------------------------------------------------------------------------------------------+

                                              absolute-max-results))))))


(defn- pre-log-query [qp]
  (fn [query]
    (when (and (mbql-query? query)
