 (ns suricatta.impl
   (:require [jdbc.core :as jdbc]
             [jdbc.types :as jdbctypes]
+            [jdbc.proto :as jdbcproto]
             [suricatta.types :as types]
             [suricatta.proto :as proto])
   (:import org.jooq.impl.DSL

      (-> (apply vector
                 (proto/get-sql q :indexed dialect)
                 (proto/get-bind-values q))
          (jdbctypes/normalize conn options)))))

;; clojure.jdbc interoperability
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(extend-protocol jdbcproto/ISQLStatement
  Query
  (normalize [q conn options]
    (let [dialect (JDBCUtils/dialect (:connection conn))]
      (-> (apply vector
                 (proto/get-sql q :indexed dialect)
                 (proto/get-bind-values q))
          (jdbcproto/normalize conn options))))

  ResultQuery
  (normalize [q conn options]
