 
 (defn- gs-collection-attributes [db dataset collection]
   ;(println "attributes")
-  (let [table (visualization dataset collection)
+  (let [table collection
         columns (pg/table-columns db dataset table)
         no-defaults (filter #(not (some #{(:column_name %)} ["gid"
                                                              "_id"


(defn- execute-update-sql [db dataset collection columns update-vals]
  (try
    (let [sql (gs-update-sql dataset (visualization dataset collection) (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)))))

  (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]
