    [qbits.alia.manifold :as aliam]
    [qbits.hayt :as h]
    [er-cassandra.key :as k]
-   [er-cassandra.record :as r]
-   [er-cassandra.record-either :as re]
+   [er-cassandra.record-either :as r]
    [er-cassandra.model.types :as t]
    [er-cassandra.model.util :refer [combine-responses create-lookup-record]]
    [er-cassandra.model.unique-key :as uk])

(defn delete-record
  [session model table key-value]
  (m/with-monad dm/either-deferred-monad
    (m/mlet [delete-result (re/delete session
                                      (:name table)
                                      (:key table)
                                      key-value)]

                               t
                               lookup-record))))

          (when-let [key-value (k/extract-key-value key record)]
            (let [lookup-record (create-lookup-record
                                 uber-key uber-key-value
                                 key key-value)]
              [(upsert-record session model t lookup-record)]))))))))

(defn upsert
