      (loop [[x & more] xs ctx ctx]
        (when x
          (recur more (cond
-                      (vector? x) (do (println "vector")
-                                      (insert-vector x session ctx ))
-                      (seq? x) (do (println "seq:" (::prior ctx))
-                                   (doseq [y x]
-                                     (insert (merge (::prior ctx)
-                                                    y)
-                                             session
-                                             ctx)))
-                      (map? x) (do (println "map")
-                                   (insert x session (assoc ctx ::prior x)))
-                      :else (throw (ex-info (str "Invalid value " x) {}))
-                      ))))))
+                      (vector? x) (insert-vector x session ctx )
+                      (seq? x) (doseq [y x]
+                                 (insert (merge (::prior ctx) y)
+                                         session
+                                         ctx))
+                      (map? x) (insert x session (assoc ctx ::prior x))
+                      :else (throw (ex-info (str "Invalid value " x) {}))))))))
 
 (defn load-fixture [session fixture]
   (let [data (compile-element fixture)]
-    (clojure.pprint/pprint data)
     (insert-vector data session)))

(defmethod compile-element clojure.lang.ISeq [xs]
  (for [x xs] (compile-element x)))

(defn- insert* [session table values]
  (dbnew/execute session
     (hayt/insert table (hayt/values values))))

(defn- insert-simple [x session]
    (let [id (str (generators/uuid))
        data (-> x
                 (assoc :id id)
                 (dissoc x ::table))]
      (insert* session (::table x) data)
      id))

(defmulti insert (fn [x _ _] (::table x)) :default :error-no-table)

(defmethod insert :error-no-table [x _ _ ]
  (throw (ex-info "ERROR - NO TABLE:" x)))

(defmethod insert :programmes [x session ctx]
  (assoc ctx :programme_id
         (insert-simple x session)))

(defmethod insert :projects [x session ctx]
  (assoc ctx :project_id
         (insert-simple x session)))

(defmethod insert :entities [x session ctx]
  (assoc ctx :entity_id
         (insert-simple x session)))

(defmethod insert :properties [x session ctx]
  (assoc ctx :property_id
         (insert-simple x session)))

(defmethod insert :devices [x session ctx]
  (let [m {:id (str (generators/uuid))


  (when (contains? x :value)
    (let [m (select-keys ctx [:device_id :type])]
      (insert* session (merge
                        x
                        m))))
  ctx)

(defn insert-vector
