    returns a Deferred[Either], with Right values describing how
    they were successful, and Left values describing errors"
 
-  [session ^Model model unique-key-table record]
+  [session ^Model model unique-key-table unique-key-record]
 
   (m/with-monad dm/either-deferred-monad
     (m/mlet [insert-response (re/insert session
                                         (:name unique-key-table)
-                                        record
+                                        unique-key-record
                                         {:if-not-exists true})
 
              inserted? (m/return (applied? insert-response))

                                      session
                                      (:name unique-key-table)
                                      (:key unique-key-table)
                                      record
                                      {:only-if
                                       (t/extract-uber-key-equality-clause
                                        model




(defn upsert
  "upsert a single instance, creating primary, secondary, unique-key and
   lookup records as required"
