Skip to content

Commit

Permalink
multi gsi
Browse files Browse the repository at this point in the history
  • Loading branch information
WBSemple committed May 10, 2024
1 parent 9be71cb commit 24c8885
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/taoensso/faraday.clj
Original file line number Diff line number Diff line change
Expand Up @@ -836,13 +836,14 @@
[table table-desc {:keys [throughput gsindexes stream-spec billing-mode] :as params}]
(assert (not (and throughput
(= :pay-per-request billing-mode))) "Can't specify :throughput and :pay-per-request billing-mode")
(let [attr-defs (keydefs nil nil nil [gsindexes])]
(let [gsindexes (cond-> gsindexes (map? gsindexes) vector)
attr-defs (keydefs nil nil nil gsindexes)]
(doto-cond
[_ (UpdateTableRequest.)]
:always (.setTableName (name table))
throughput (.setProvisionedThroughput (provisioned-throughput throughput))
billing-mode (.setBillingMode (utils/enum billing-mode))
gsindexes (.setGlobalSecondaryIndexUpdates [(global-2nd-index-updates table-desc gsindexes)])
gsindexes (.setGlobalSecondaryIndexUpdates (mapv (partial global-2nd-index-updates table-desc) gsindexes))
stream-spec (.setStreamSpecification (stream-specification stream-spec))
(seq attr-defs) (.setAttributeDefinitions attr-defs))))

Expand Down

0 comments on commit 24c8885

Please sign in to comment.