 (defn update-wishlist [wish]
   (let [{:keys [id]} wish]
     (sql/with-connection db
-	  (sql/update-values :wish ["id=?" id] wish))))+      (sql/update-values :wish ["id=?" id] wish))))

(defn update-wishlist [wishlist]
  (let [{:keys [id]} wishlist]
    (sql/with-connection db
	  (sql/update-values :wishlist ["id=?" id] wishlist))))

(defn get-wishes-for-wishlist [{:keys [id]}]
  (sql/with-connection db
    (sql/with-query-results results
	  ["select * from wish where wishlist=?" id]
	  (into [] results))))

(defn insert-wish [wish {:keys [id]}]
  (sql/with-connection db

  (:require [clojure.java.jdbc :as sql]))

(def db {:classname "org.postgresql.Driver"
         :subprotocol "postgresql"
         :subname "//localhost:5432/cwl"
         :user "cwl"
         :password "wish"})
;wishlist
;[:id :serial "PRIMARY KEY"]
;[:title :varchar "NOT NULL"]
;[:code :varchar :unique]
;[:created_at :timestamp "NOT NULL" "DEFAULT CURRENT_TIMESTAMP"])))

;wish
