   ...]`, in which case it will be transformed into `key = value1 OR
   key = value2 ...`. Nested vectors is supported."
   [k v]
-  (let [k (name k)]
+  (let [qk (qualified-name k)]
     (condp #(= % (type %2)) v
       PersistentVector (let [[op & values] v]
                          (->> values
                               (map (partial keyval-to-sql k))
                               (interpose (str " " (name op) " "))
                               string/join))
-      String (format "(%s = '%s')" k v)
-      Boolean (format "(%s = %s)" k (if v 1 0))
-      nil (format "(%s is NULL)" k)
-      (format "(%s = %s)" k v))))
+      String (format "(%s = '%s')" qk v)
+      Boolean (format "(%s = %s)" qk (if v 1 0))
+      Keyword (format "(%s = %s)" qk (qualified-name v))
+      nil (format "(%s is NULL)" qk)
+      (format "(%s = %s)" qk v))))
 
 ;; ### SQL operations
 

    Double (.getDouble cur i)
    Byte (.getBlob cur i)))

(defn- keyval-to-sql
  "Transforms a key-value pair into a proper SQL comparison/assignment
  statement.

  "Returns SQLiteDatabase instance for the given schema or helper. Access-mode
  can be either `:read` or `:write`."
  {:forms '([context schema-or-helper access-mode])}
  ([^SQLiteOpenHelper helper, access-mode]
   {:pre [(#{:read :write} access-mode)]}
   (if (instance? SQLiteHelper helper)
     (TaggedDatabase. (case access-mode
                        :read (.getReadableDatabase helper)
                        :write (.getWritableDatabase helper))
                      (.schema helper))
     (do (println "Context-less version version is deprecated.
Please use (get-database context schema access-mode) or (get-database helper access-mode)")
         (get-database context helper access-mode))))
  ([context schema access-mode]
   (get-database (create-helper context schema) access-mode)))

