Dynamo DB Pages

Dynamo code snippet

Recently got burned because we needed to do a recursive paging through dynamo

var listOfThings []Whatever

err := store.ScanPages(input,
    func (page *dynamodb.ScanOutput, lastPage bool) bool {
        for _, item := range page.Items {
            var whateva Whatever
            if val, ok := item["jval"]; ok {
                err := json.Unmarshal([]byte(*val.S), &whateva)
                if err != nil {
                    return true // its like continue
                }
                listOfThings = append(listOfThings, whateva)
            }
        }
    return !lastPage
})
if err != nil {
    t.Fail()
}


updated: 2 October 2021.

=> to the Index | / html

Proxy Information
Original URL
gemini://shiny.bneil.me/notes/dynamodb_pages/index.gmi
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
139.267085 milliseconds
Gemini-to-HTML Time
0.175736 milliseconds

This content has been proxied by September (ba2dc).