                                record-or-key-value
                                opts)
 
-       (if-let [lookup-table (if-lookup-key-table model key)]
+       (if-let [lookup-table (or (if-unique-key-table model key)
+                                 (if-lookup-key-table model key))]
 
          (select-from-lookup-table session
                                    model

   (select-one session model key record-or-key-value {}))

  ([session ^Model model key record-or-key-value opts]
   (d/chain (select session model key record-or-key-value opts)
            first)))

(ns er-cassandra.model.select
  (:require [manifold.deferred :as d]
            [cats.core :as m]
            [cats.monad.either :as either]
            [cats.monad.deferred :as dm]
            [qbits.alia :as alia]
            [qbits.alia.manifold :as aliam]
            [qbits.hayt :as h]
            [er-cassandra.key :as k]
            [er-cassandra.record-either :as r]
            [er-cassandra.model.types :as t])
  (:import [er_cassandra.model.types Model]))

(defn if-primary-key-table
