Fork me on GitHub

I tried setting column, [:data] in my case, I had some errors, going to try wrap the object is a map like that


beautiful, it works, @hiredman thank you! This is a public catalog of producs I'm updating peridically (take 10 just for debugging)

(defn atomically-update-catalog [new-items]
  (jdbc/with-db-transaction [trans-conn @db]
    (jdbc/db-do-commands trans-conn
                         "DROP TABLE IF EXISTS catalog"
                         ;; (jdbc/drop-table-ddl :catalog)
                         (jdbc/create-table-ddl :catalog
                                                [:id "serial" "NOT NULL" "PRIMARY KEY"]
                                                [:data "json" "NOT NULL"]))
    (apply jdbc/insert! trans-conn :catalog new-items)))

(let [options {:headers {"Content-Type" "application/x-www-form-urlencoded"}}
      {:keys [status error body]} @(http/post const/feed-url  options)]
  (if error
    (println "Failed, exception is " error)
    (-> (mapv #(hash-map :data (pg-types/map->parameter % :json))
              (take 10 (-> body json/read-json)))
nice to see that when I query the items in clojure, I get them in EDN! Nice!