 ;; Creation/update functions
 
 ;; TODO: schematode may have a thing that does this?
-(defn with-constraints
+(defn tx
   "transact with schematode constraints"
-  [conn tx]
-  (d/transact conn [[:schematode-tx [tx]]]))
-
-(defn- transact-entity-fn
-  [fields]
-  (fn [conn eid & {:as updates}]
-    (with-constraints conn (merge {:db/id eid} (select-keys updates fields)))))
+  [conn txs]
+  (schematode/tx conn :enforce txs))
+
+#_(defn- transact-entity-fn
+  [valid-fields]
+  (fn [conn eid & {:as fields}]
+    (tx conn (merge {:db/id eid} (select-keys fields valid-fields)))))
 
 (defn- update-entity-fn
   [updatable-fields transact-fn]
-  (fn [conn & {:keys {eid} :as entity}]
+  (fn [conn & {:keys [eid] :as entity}]
     (apply transact-fn conn eid (select-keys entity updatable-fields))))
 
-(def transact-competency
-  ^{:private true}
-  (transact-entity-fn [:comp/id-sk :comp/name :comp/description :comp/version :comp/status :comp/tags]))
-
-;; TODO: can we update name-version?
-;; TODO: this?
-(def update-competency
-  (update-entity-fn [:comp/description :comp/status] transact-competency))
-
-;; TODO: or this?   -- this seems better from a readability standpoint
-(defn update-competency2
-  [conn & {:keys {eid} :as entity}]
-  (let [updatable-fields [:comp/description :comp/status]]
-    (apply transact-competency conn eid (select-keys entity updateable-fields))))
+(defn- transact-competency
+  [conn eid & {:as entity}]
+  (tx conn [(merge {:db/id eid} (select-keys entity (:comp valid-fields)))]))
+
+(defn update-competency
+  "Consider using :comp/id-sk instead of the entity ID here, IF every :comp has a :comp/id-sk."
+  [conn & {:keys [eid] :as entity}]
+  (apply transact-competency conn eid (select-keys entity (:comp updatable-fields))))
 
 (defn create-competency
   "Create a new competency"

  (apply transact-competency conn (d/tempid :db.part/user)
         :comp/name name
         :comp/version version
         (flatten (seq optional-fields))))

(def transact-comp-tag
  ^{:private true}
  (transact-entity-fn [:comp-tag/name
                       :comp-tag/description
                       :comp-tag/version

  (apply update-comp-tag-disp-ctx (d/tempid :db.part/user) :comp-tag-disp-ctx/name name))

(def transact-perf-asmt
  #_
  (transact-entity-fn [:perf-asmt/id-sk
                       :perf-asmt/name
                       :perf-asmt/version
