           :C1    (:c1 lrecord)
           :C2    (:c2 lrecord)
           false  (contains? lrecord :c3))))))
+
+(deftest upsert-lookups-test)
+
+(deftest copy-unique-keys-test)
+
+(deftest has-lookups?-test
+  )
+
+(deftest update-secondaries-and-lookups-test)
+
+(deftest upsert*-test)

               {:id :a :baz #{:c}}
               (-> m :lookup-key-tables second))))))))

(deftest stale-secondary-key-value-test
  (let [m (t/create-entity
           {:primary-table {:name :foos :key [:id]}
            :secondary-tables [{:name :foos_by_bar :key [:bar]}]})
        st (-> m :secondary-tables first)]

    (testing "ignores secondary keys when missing from new-record"
      (is (= nil
             (u/stale-secondary-key-value
              m
              {:id :a :bar :b}
              {:id :a}
              (-> m :secondary-tables first)))))

    (testing "correctly identifies a stale singular secondary key value"
      (is (= [:b]
             (u/stale-secondary-key-value
              m
              {:id :a :bar :b}
              {:id :a :bar nil}
              (-> m :secondary-tables first)))))))

(deftest with-columns-option-for-lookups
  (let [m (t/create-entity

                   "(id timeuuid primary key, nick text)")
  (t/create-entity
   {:primary-table {:name :simple_upsert_test :key [:id]}}))

(defn create-secondary-entity
  []
  (tu/create-table :secondary_upsert_test
                   "(org_id timeuuid, id timeuuid, nick text, primary key (org_id, id))")
  (tu/create-table :secondary_upsert_test_by_nick
                   "(org_id timeuuid, nick text, id timeuuid, primary key (org_id, nick))")
  (t/create-entity
   {:primary-table {:name :secondary_upsert_test :key [:org_id :id]}
    :secondary-tables [{:name :secondary_upsert_test_by_nick
                        :key [:org_id :nick]}]}))

(deftest delete-record-test
  (let [m (create-simple-entity)
