 
 (defn- execute-update-sql [db dataset collection columns update-vals]
   (try
-    (let [sql (gs-update-sql dataset (visualization dataset collection) (map name columns))]
+    (let [table collection
+          sql (gs-update-sql dataset table (map name columns))]
       (j/execute! db (cons sql update-vals) :multi? true :transaction? false))
     (catch java.sql.SQLException e
       (log/with-logs ['pdok.featured.projectors :error :error] (j/print-sql-exception-chain e)))))

    (let [selector (juxt :dataset :collection)
          per-dataset-collection (group-by selector features)]
       (doseq [[[dataset collection] collection-features] per-dataset-collection]
        (let [sql (gs-delete-sql dataset (visualization dataset collection))
              ids (map #(vector (:id %1) (:current-version %1)) collection-features)]
          (j/execute! db (cons sql ids) :multi? true :transaction? false))))
    (catch java.sql.SQLException e

  (pg/create-schema db dataset))

(defn- gs-collection-exists? [db dataset collection]
  (let [table collection]
    (pg/table-exists? db dataset table)))

(defn- gs-create-collection [db ndims srid dataset collection]
  "Create table with default fields"
  (let [table collection]

      (pg/create-table db dataset table
                [:gid "serial" :primary :key]
