   (select heads-by-tentacle
           (where {:tentacle_name (:name tentacle)})))
 
-(defn save-head!
+(defn create-head!
   [head]
   (log/info "Saving head:" head)
   (insert heads

  (select tentacles-by-head
          (where {:head_name (:name head)})))

(defn save-tentacle!
  [tentacle]
  (log/info "Saving tentacle:" tentacle)
  (insert tentacles
          (values tentacle)))

(defn update-tentacle!
  [tentacle]
  (log/info "Updating tentacle" (:name tentacle) "with values:" tentacle)
  (update tentacles
          (set-fields tentacle)
          (where {:name (:name tentacle)})))

(defn delete-tentacle!
  [tentacle]


(defn update-head!
  [head]
  (log/info "Updating head:" (:name head) "with values" head)
  (update heads
          (set-fields head)
          (where {:name (:name head)})))

(defn save-head!
  [head]
  (if-not (empty? (get-head (:name head)))
    (update-head! head)
    (create-head! head)))

(defn delete-head!
  [head]
