-
Notifications
You must be signed in to change notification settings - Fork 2
Implement basic DynamoDB API adapter #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a DynamoDB-compatible HTTP API adapter to elastickv, enabling it to serve as a local DynamoDB substitute for testing and development purposes.
- Implements a DynamoDB HTTP server supporting PutItem, GetItem, UpdateItem, and TransactWriteItems operations
- Adds a transcoder to convert DynamoDB JSON requests into internal key-value operations
- Integrates the DynamoDB server into the test harness alongside existing gRPC and Redis servers
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Adds AWS SDK for Go dependency |
| adapter/test_util.go | Extends test infrastructure to include DynamoDB server setup and port management |
| adapter/dynamodb_transcoder.go | Implements conversion from DynamoDB JSON format to internal operation format |
| adapter/dynamodb_test.go | Provides comprehensive test coverage for DynamoDB API operations |
| adapter/dynamodb.go | Core DynamoDB HTTP server implementation with request handling and condition validation |
| } | ||
|
|
||
| type attributeValue struct { | ||
| S string `json:"S"` |
Copilot
AI
Aug 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The attributeValue struct only supports string values (S field), but DynamoDB supports multiple data types (N for numbers, B for binary, etc.). This limits the adapter's compatibility with real DynamoDB usage.
| S string `json:"S"` | |
| S *string `json:"S,omitempty"` | |
| N *string `json:"N,omitempty"` | |
| B *[]byte `json:"B,omitempty"` | |
| SS *[]string `json:"SS,omitempty"` | |
| NS *[]string `json:"NS,omitempty"` | |
| BS *[][]byte `json:"BS,omitempty"` | |
| BOOL *bool `json:"BOOL,omitempty"` | |
| NULL *bool `json:"NULL,omitempty"` | |
| L *[]attributeValue `json:"L,omitempty"` | |
| M *map[string]attributeValue `json:"M,omitempty"` |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Summary
Testing
go test ./...go test -race ./...(fails: TestRbMemoryStore_TTL)golangci-lint --config=.golangci.yaml run --fixhttps://chatgpt.com/codex/tasks/task_e_68977637c0f88324922ae3a2af7b1776