   (atom {}))
 
 (defn kv-whole-map
-  "Returns a hashmap snapshot of the entire database"
+  "Returns a hashmap snapshot of the entire database
+  {k [type value] ...}"
   [db]
   (into {}
     (map
-    #((comp vec list) (first %) [(first (second %)) (deref (second (second %)))])
+    #((comp vec list)
+      (first %) ; key
+      [(first (second %)) ; type
+        (deref (second (second %)))]) ; value
     @db)))
 
 (defn kv-value

    ks)))

(defn kv-get
  "Returns (:ok value)"
  [db k]
  (let [[type value-atom] (get @db k)]
    (if (= type :raw)
      (list :ok @value-atom)
      (list :error :type-mismatch))))

(defn kv-exists
  "Returns (:ok num) where num is the number of keys that exist"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Catch errors in kv_parse
;; Hashmap functions https://redis.io/commands#hash
;; Set functions https://redis.io/commands#set
;; Metadata for naming databases
;; Do values have to be returned with every command?

;; LATER TODO
;; Add radix tree?
