       (csv-seq params
                template
                (map (partial zipmap header) (next lines))
+               (constantly true)
                lines))))

  (csv-seq params
           template
           (map (partial assoc {:limit page-size} :offset)
                (iterate (partial + page-size) start-from))))

(defn piped-query
  "Run the query from `template` with each line of input provided as template parameters."

    (with-open [writer (io/writer output :append (and append? (util/file-exists? output)))]
      (dorun (csv/write-csv writer
                            (->> (map-fn query-fn param-seq base-lines (iterate inc 0))
                                 (take-while stopping-condition)
                                 util/lazy-cat')
                            :separator delimiter)))))

