Skip to content

Conversation

@bootjp
Copy link
Owner

@bootjp bootjp commented Aug 9, 2025

Summary

  • add DynamoDB-compatible HTTP server supporting PutItem and GetItem
  • translate DynamoDB JSON requests into internal operations
  • test DynamoDB adapter using AWS SDK DynamoDB client and update test harness

Testing

  • go test ./...
  • go test -race ./... (fails: TestRbMemoryStore_TTL)
  • golangci-lint --config=.golangci.yaml run --fix

https://chatgpt.com/codex/tasks/task_e_68977637c0f88324922ae3a2af7b1776

@bootjp bootjp requested a review from Copilot August 10, 2025 04:26
Copy link

Copilot AI left a 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"`
Copy link

Copilot AI Aug 10, 2025

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.

Suggested change
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"`

Copilot uses AI. Check for mistakes.
bootjp and others added 2 commits August 10, 2025 14:04
@bootjp bootjp closed this Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants