 
 (defn get-tentacles-for-head
   [head]
-  (select tentacles
-          (where {:head-name (:name head)})))
+  (select tentacles-by-head
+          (where {:head_name (:name head)})))
 
 (defn save-tentacle!
   [tentacle]

  [name]
  (first (select heads
                 (where {:name name})
                 ;; (with tentacles)
                 (limit 1))))

(defn get-all-heads
  []
  (select heads
          ;; (with tentacles)
          ))

(defn save-head!
  [head]

;; both of the other tables you're attempting to look up. Getting from Heads to
;; Tentacles (or vice-versa) is now a set of left-joins. Easy peasy!
(defentity head-tentacle-mappings
  (table :head_tentacle_mappings)
  (prepare ->snake-keys)
  (transform ->kebab-keys)
  (belongs-to heads)
  (belongs-to tentacles))

(defentity tentacles-by-head
  (table (subselect head-tentacle-mappings
                    (join tentacles (= :head_tentacle_mappings.tentacle_name :tentacles.name))
                    (fields :head_tentacle_mappings.head_name
                            :tentacles.name
                            :tentacles.output_root
                            :tentacles.html_commands
                            :tentacles.source_control
                            :tentacles.entry_point))
         :tentacles_by_head)
  ;; These don't seem to have any effect and I have no idea why.
  (prepare ->snake-keys)
  (transform ->kebab-keys))

(defentity heads-by-tentacle
  (table (subselect head-tentacle-mappings
                    (join heads (= :head_tentacle_mappings.head_name :heads.name))
                    (fields :head_tentacle_mappings.tentacle_name :heads.name))
         :heads_by_tentacle))

(defn get-tentacle
  [name]
