                           :completed? (volatile! false)
                           :offset (volatile! nil)})))
 
-(defn- coerce-copy-row
-  "Coerces a row map object into a format that's understood by the PostgreSQL COPY TEXT format."
-  [cols row]
+(defn- column->sql-value
+  "Coerces a column a format that's understood by the PostgreSQL COPY TEXT format."
+  [col]
   (let [xform-escape (fn [x]
                        (cond
                          (string? x)

        ostream (PGCopyOutputStream. copy)]

    (doseq [row rows]
      (let [cbuf (.getBytes (coerce-copy-row cols row) "UTF-8")]
        (.write ostream cbuf)))

    (.endCopy ostream)))

(defn- jdbc-insert-multi! [table conn rows]

        xform-null (fn [x]
                     (if (nil? x) "\\N" x))

        xform (comp str
                    xform-null
                    xform-escape
                    jdbc/sql-value)]
    (xform col)))

(defn- pgsql-copy
  "Uses PostgreSQL CopyMan to quickly load batches of rows into our destination table. Transaction
