 
 (def db-client (memoize db-client*))
 
-;;;; Coercions ; TODO ?
-
-(defprotocol AsMap (as-map [x]))
-
-(defn- to-long [x] (Long. x))
+(defn- coerce-num [x] (if (.contains x ".") (Double. x) (Long. x)))
 
 (defn- get-value "Returns the value of an AttributeValue object."
-  [attr-value] ; TODO ?
+  [attr-value]
   (or (.getS attr-value)
-      (some->> (.getN attr-value)  to-long)
-      (some->> (.getNS attr-value) (map to-long) (into #{}))
+      (some->> (.getN attr-value)  coerce-num)
+      (some->> (.getNS attr-value) (map coerce-num) (into #{}))
       (some->> (.getSS attr-value) (into #{}))))
 
 (defn- key-schema-element "Returns a new KeySchemaElement object."


  The throughput is a map with two keys:
    :read  - the provisioned number of reads per second
    :write - the provisioned number of writes per second" ; TODO
  [creds {:keys [name hash-key range-key throughput]}]
  (.createTable
   (db-client creds)

;; * Docs.
;; * Bench.

;;;; DynamoDB API objects

(defn- db-client*
  "Returns a new AmazonDynamoDBClient instance for the supplied IAM credentials."
  [{:keys [access-key secret-key endpoint proxy-host proxy-port] :as creds}]
  (let [aws-creds     (BasicAWSCredentials. access-key secret-key)
        client-config (ClientConfiguration.)]
