    [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])
+   [er-cassandra.model.unique-key :as unique-key])
   (:import [er_cassandra.model.types Model]))
 
 (defn delete-record

                                 key key-value)]
              [(upsert-record session model t lookup-record)]))))))))

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

        (if coll
          (let [old-kvs (set (k/extract-key-value-collection key old-record))
                new-kvs (set (k/extract-key-value-collection key new-record))
                stale-kvs (filter identity (set/difference old-kvs new-kvs))]
            (for [kv stale-kvs]
              (delete-record session model t kv)))

