{"id":37197651,"url":"https://github.com/shawnsmithdev/ddbmap","last_synced_at":"2026-01-14T22:58:16.802Z","repository":{"id":57489284,"uuid":"139393650","full_name":"shawnsmithdev/ddbmap","owner":"shawnsmithdev","description":"Go library that presents a map-like view of a DynamoDB table (AWS Go SDK v2)","archived":true,"fork":false,"pushed_at":"2019-08-15T23:20:21.000Z","size":85,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T14:26:37.579Z","etag":null,"topics":["aws","aws-dynamodb","go"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shawnsmithdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-02T05:13:36.000Z","updated_at":"2024-06-20T14:26:37.580Z","dependencies_parsed_at":"2022-08-29T20:30:44.076Z","dependency_job_id":null,"html_url":"https://github.com/shawnsmithdev/ddbmap","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/shawnsmithdev/ddbmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fddbmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fddbmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fddbmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fddbmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shawnsmithdev","download_url":"https://codeload.github.com/shawnsmithdev/ddbmap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fddbmap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28437682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-dynamodb","go"],"created_at":"2026-01-14T22:58:16.158Z","updated_at":"2026-01-14T22:58:16.761Z","avatar_url":"https://github.com/shawnsmithdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/shawnsmithdev/ddbmap.svg)](https://travis-ci.org/shawnsmithdev/ddbmap)\n[![GoDoc](https://godoc.org/github.com/shawnsmithdev/ddbmap?status.png)](https://godoc.org/github.com/shawnsmithdev/ddbmap)\n[![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/shawnsmithdev/ddbmap/master/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/shawnsmithdev/ddbmap)](https://goreportcard.com/report/github.com/shawnsmithdev/ddbmap)\n\n# ddbmap\n`ddbmap` is a Go (golang) library and module that presents a map-like view of an AWS DynamoDB table.\n\n# Example\n```go\npackage main\n\nimport (\n    \"github.com/aws/aws-sdk-go-v2/aws\"\n    \"github.com/aws/aws-sdk-go-v2/aws/external\"\n    \"github.com/shawnsmithdev/ddbmap\"\n    \"fmt\"\n)\n\ntype Person struct {\n    Id   int\n    Name string\n    Age  int\n}\n\nfunc main() {\n    awsCfg, _ := external.LoadDefaultAWSConfig()\n    awsCfg.Retryer = aws.DefaultRetryer{NumMaxRetries: 100}\n\n    // Assumes table already exists, will auto-discover key names\n    tCfg := ddbmap.TableConfig{\n        TableName:         \"TestTable\",\n        ValueUnmarshaller: ddbmap.UnmarshallerForType(Person{}),\n    }\n    people, _ := tCfg.NewMap(awsCfg)\n\n    // put\n    p1 := Person{Id: 1, Name: \"Bob\", Age: 20}\n    err := people.Store(p1)\n\n    // get\n    p2, loaded, err := people.Load(Person{Id: 1})\n    if loaded \u0026\u0026 err == nil {\n        fmt.Println(p2.(Person)) // same as p1\n    }\n\n    // iterate\n    err = people.Range(func(p3 interface{}) bool {\n        fmt.Println(p3.(Person)) // same as p1\n        return true\n    })\n}\n```\n\n# Your table, as a map\nOne way to view a DynamoDB table is as kind of a [hashmap](https://en.wikipedia.org/wiki/Hash_table) in the cloud.\n\nThis library ignores some of the features of DynamoDB, such as range key queries and batching,\nto provide a simple API to access a table.\n\n* Get a single record\n* Put a single record\n* Delete a single record\n* Conditional Put If Absent\n* Iterate over all records (serially or in parallel)\n\nNote that you must either use capitalized DynamoDB field names, or add struct tags like `dynamodbav` to rename\nexported fields.\n\n# Item API\nThe `ddbmap.ItemMap` API may be used by implementing `ddbmap.Itemable` to handle conversions between the Go and\nDynamoDB type system, with or without using reflection.\n\n# Conditional Updates (versions)\n[Conditional updates](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html#WorkingWithItems.ConditionalUpdate),\nwhere the condition is stronger than just a record's absence, is supported by defining a numerical version field\nand configuring `VersionName` in the `TableConfig` to the name of that field.\n\n# Time To Live\nIf the `TimeToLiveDuration` field in the `TableConfig` is set, each record will be stored with a new number field\nset to Unix epoch seconds of time the record was stored, plus the configured duration. This is useful when using the\n[TTL](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html) feature of DynamoDB tables.\nThe field name is `TTL` by default but can be changed with `TimeToLiveName` in `TableConfig`.\n\n# Dependencies\nThis library depends on the AWS Go SDK v2 and `golang.org/x/sync`.\nIf building with a go version older than 1.11, you will need to install these dependencies manually.\n```\ngo get -u github.com/aws/aws-sdk-go-v2\ngo get -u golang.org/x/sync\n```\n\n# TODO\n* Test range early termination\n* Test other set types, null\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawnsmithdev%2Fddbmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshawnsmithdev%2Fddbmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawnsmithdev%2Fddbmap/lists"}