Skip to content

Commit

Permalink
Add (cached) upgrade warnings for #73
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Nov 30, 2015
1 parent a9c7788 commit 7507b80
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/taoensso/faraday.clj
Expand Up @@ -682,6 +682,14 @@

(defn- clj->db-expr-vals-map [m] (encore/map-vals clj-val->db-val m))

(def ^:private deprecation-warning-expected_
(delay
(println "Faraday WARNING: `:expected` option is deprecated in favor of `:cond-expr`")))

(def ^:private deprecation-warning-update-map_
(delay
(println "Faraday WARNING: `update-map` is deprecated in favor of `:cond-expr`")))

(defn put-item-request
[table item &
[{:keys [return expected return-cc? cond-expr expr-attr-names expr-attr-vals]
Expand Down Expand Up @@ -714,6 +722,8 @@
(assert (not (and expected cond-expr))
"Only one of :expected or :cond-expr should be provided")

(when expected @deprecation-warning-expected_)

(as-map
(.putItem (db-client client-opts)
(put-item-request table item opts))))
Expand Down Expand Up @@ -774,6 +784,9 @@
(assert (not (and update-expr (seq update-map)))
"Only one of 'update-map' or :update-expr should be provided")

(when expected @deprecation-warning-expected_)
(when (seq update-map) @deprecation-warning-update-map_)

(as-map
(.updateItem (db-client client-opts)
(update-item-request table prim-kvs update-map opts)))))
Expand Down

0 comments on commit 7507b80

Please sign in to comment.