This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-24
Channels
- # announcements (5)
- # aws (5)
- # aws-lambda (6)
- # babashka (6)
- # beginners (48)
- # calva (54)
- # clj-commons (12)
- # clj-kondo (39)
- # cljfx (3)
- # cljs-dev (11)
- # clojure (91)
- # clojure-europe (25)
- # clojure-uk (3)
- # clojurescript (16)
- # cursive (2)
- # data-oriented-programming (6)
- # datomic (8)
- # emacs (10)
- # events (3)
- # fulcro (2)
- # functionalprogramming (2)
- # graalvm (4)
- # graphql (2)
- # helix (1)
- # honeysql (4)
- # jobs (1)
- # malli (4)
- # nextjournal (21)
- # off-topic (5)
- # other-languages (4)
- # overtone (3)
- # reitit (17)
- # releases (2)
- # rewrite-clj (6)
- # ring (6)
- # shadow-cljs (37)
Hi guys - does anyone have experience with sending binary data to DynamoDB via the Cognitect AWS API?
✅ 1
(aws/invoke ddb
{:op :PutItem
:request {:TableName "my-table"
:Item {:pk {:S "myData"}
:myData {:B (nippy/freeze {:hello :world})}}}})
(aws/invoke ddb
{:op :GetItem
:request {:TableName "my-table"
:Key {:pk {:S "myData"}}}})
#_{:Item {:pk {:S "myData"},
:myData {:B #object[java.io.BufferedInputStream
"0x4606379e"
"java.io.BufferedInputStream@4606379e"]}}}
(-> *1 :Item :myData :B .readAllBytes nippy/thaw)
;;; {:hello :world}
(`.readAllBytes` i think was only added in a slight more recent java version, maybe 1.9? )
@U064UGEUQ Many thanks, I came right. I needed to send a binary blob which was zlib-compressed JSON; what I did was I shelled out and used pigz (from babashka) and wrapped the console output in (byte-array)