 (defn compile-sql
   [table geom-column popups]
   (let [geom-spec [geom-column "geom"]
-
         selects (vec (map #(let [[alias column] (first %)]
                              [column alias])
                           popups))

        fmt-string (str/replace prepared-statement #"\?" "%s")]
    (apply (partial format fmt-string) args)))

(defn map-config-layer
  [tenant-conn {:strs [datasetId popup pointSize]}]
  (let [dataset (dataset-by-id tenant-conn {:id datasetId})
        table-name (:table-name dataset)
        geom-column "d1"]
    {"type" "mapnik"
     "options" {"cartocss" (cartocss pointSize)
                "cartocss_version" "2.0.1"

(ns akvo.lumen.lib.visualisation.map-config
  (:require [clojure.java.jdbc :as jdbc]
            [clojure.string :as str]
            [honeysql.core :as sql]
            [hugsql.core :as hugsql]))

