 
 (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]
+  (log/warn "Deleting tentacle:" tentacle "!")
   (delete tentacles
           (where {:name (:name tentacle)})))
 

(ns doctopus.db
  (:require [korma.db :refer [defdb postgres]]
            [clojure.string :as string :refer [split-lines]]
            [korma.core :refer :all]
            [clj-time.coerce :refer [to-sql-time]]
            [clj-time.core :as clj-time]
            [camel-snake-kebab.core :refer [->snake_case_keyword ->kebab-case-keyword]]
            [camel-snake-kebab.extras :refer [transform-keys]]
            [doctopus.configuration :refer [server-config]]))

(defn- now
  []

                                 (where {:head_name head-name
                                         :tentacle_name tentacle-name}))]
    (if (empty? existing-mapping)
      (do
        (log/info "Creating mapping from head" head-name "to tentacle" tentacle-name)
        (insert head-tentacle-mappings
                (values {:head-name head-name :tentacle-name tentacle-name})))
      (log/info "Mapping from" head-name "to" tentacle-name "already exists"))))

(defn remove-mapping!
  [head tentacle]
  (log/warn "Removing mapping between head" (:name head) "and tentacle" (:name tentacle))
  (delete head-tentacle-mappings
          (where {:head-name (:name head)
                  :tentacle-name (:name tentacle)})))

(defn get-all-mappings
  []
