Welcome

The protoc-gen-dynamodb Protocol Buffer ("proto") compiler plugin generates a convenient Go API to map proto messages to DynamoDB items and vice versa.

The plugin works well together with buf or the stock protoc compiler.

Express your DynamoDB document structure as Protocol Buffer messages, annotate where necessary, and then generate a Go API without having to write boilerplate code.

Go from this:

import "dynamodb/options.proto";
message Book {
  string isbn = 1  [(dynamodb.field).partition_key = true];
  string title = 2;
  string author = 3;
}

To this:

// Import generated package:
// import appv1 "github.com/myorg/myapp/pkg/app/v1
books := appv1.DynamoDB(ddb).BookTable("novels")
book, _ := books.GetItem("978-0547928227").Execute(ctx)
fmt.Println(book.Title())
// The Hobbit

Head over to the installation guide to get started.

Checkout the examples for code samples that demonstrate some of the plugin's features and use cases.

About

Joe created this plugin in 2023 to support a few side projects that needed simple, fast, and low-cost data persistence.

Contributions from the community are most welcome. See how to contribute.

If you happen to find this project useful and would like to support its development, show your appreciation through a small donation. Thank you!

Last updated