 
   ([^ModelSession session ^Entity entity key record-or-key-value opts]
    (with-context deferred-context
-     (mlet [select-s (select-buffered session
-                                      entity
-                                      key
-                                      record-or-key-value
-                                      (merge opts {:limit 1}))]
-       (if (s/drained? select-s)
+     (mlet [r (select-one session
+                          entity
+                          key
+                          record-or-key-value
+                          opts)]
+       (if r
+         (return r)
          (d/error-deferred (ex-info
                             "no record"
                             {:reason [:fail
                                       {:entity entity
                                        :key key
                                        :record-or-key-value record-or-key-value}
-                                      :no-matching-record]}))
-         (s/take! select-s))))))
+                                      :no-matching-record]})))))))
 
 (defn ensure-one-instance
   "select-one-instance but errors if there is no record"

  ([^ModelSession session ^Entity entity key record-or-key-value opts]
   (with-context deferred-context
     (mlet [select-s (select-buffered session entity key record-or-key-value opts)]
       (return
        (s/stream->seq select-s))))))

(defn select-one
  "select a single record, using an index table if necessary"

                      entity
                      key
                      record-or-key-value
                      (merge opts {:limit 1}))]
       (s/take! select-s)))))

(defn select-one-instance
  "select a single record, unless the record is already a record retrieved
