             [pdok.featured.template :as template]
             [clojure.tools.logging :as log]
             [clojure.core.async :as a
-             :refer [>! <! >!! <!! go chan]])
+             :refer [>! <! >!! <!! go chan]]
+            [clojure.string :as str])
   (:gen-class)
   (:import (java.sql SQLException)))
 

    (if (nil? error)
      (if (nil? features-for-extract)
        {:status "ok" :count 0}
        {:status "ok" :count (add-extract-records extracts-db dataset extract-type features-for-extract)})
      {:status "error" :msg error :count 0})))


(defn- jdbc-delete-versions [db table versions]

                                  (filter (complement nil?) (map changelog->deletes records)))
        (if (= 0 (mod i 10))
          (log/info "Creating extracts" (str dataset "-" extract-type "-" collection) "processed:" (* i batch-size)))
        (recur (inc i) (a/<!! parts))))
    (log/info "Finished extract" (str dataset "-" extract-type "-" collection))))

(defn- create-extract [dataset extract-type fn-timeline-query collections]
   (if-not (every? *initialized-collection?* (map (partial template/template-key dataset extract-type)
