Skip to content

feat(api): complete DynamoDB API gaps (UpdateItem, Batch, TransactGet, Table ops)#6

Merged
poyrazK merged 8 commits into
mainfrom
ci/github-actions
Jun 13, 2026
Merged

feat(api): complete DynamoDB API gaps (UpdateItem, Batch, TransactGet, Table ops)#6
poyrazK merged 8 commits into
mainfrom
ci/github-actions

Conversation

@poyrazK

@poyrazK poyrazK commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • UpdateItem: Read-modify-write via control plane (GET → apply UpdateExpression → PUT)
  • BatchGetItem / BatchWriteItem: New RpcType 13/14 with count-prefixed ItemArgs serialization
  • TransactGetItems: New RpcType 15 for transactional reads paired with TransactWriteItems
  • Table operations: DeleteTable, DescribeTable, ListTables (Java-only, schema in ConcurrentHashMap)
  • Expression improvements: BETWEEN and IN operators in parseExpr and expression_evaluator.zig

Files Changed

  • — +581 lines (7 new handlers + expression parser)
  • — +50 lines (updateItem, batchGetItem, batchWriteItems, transactGetItems)
  • — +3 enum values (BatchGetItem, BatchWriteItem, TransactGetItems)
  • — +93 lines (RPC handlers for types 4, 13, 14, 15)
  • — +36 lines (between/in AST evaluation)
  • — updated with supported operations and build instructions
  • — new comprehensive API reference
  • — ADR documenting design decisions

Operations Now Supported (was 7, now 14)

PutItem, GetItem, DeleteItem, UpdateItem, CreateTable, Query, Scan, TransactWriteItems, TransactGetItems, BatchGetItem, BatchWriteItem, DeleteTable, DescribeTable, ListTables

poyrazK added 8 commits June 11, 2026 20:36
…es and BETWEEN/IN expressions

- Add RpcType.BatchGetItem(13), BatchWriteItem(14), TransactGetItems(15) to enum
- Add BETWEEN and IN operator support to expression_evaluator.zig
- Update README with supported operations and architecture
…ctGetItems, and table operations

- DynamoController: add handleUpdateItem (read-modify-write), handleBatchGetItem,
  handleBatchWriteItem, handleTransactGetItems, handleDeleteTable, handleDescribeTable,
  handleListTables
- DynamoController: extend parseExpr for BETWEEN and IN operators
- DynamoController: add setJsonAttribute, removeJsonAttribute, addJsonAttribute helpers
- EngineTcpClient: add updateItem(), batchGetItem(), batchWriteItems(), transactGetItems()
- Expression improvements: BETWEEN and IN in parseExpr
…iteItem, TransactGetItems

- main.zig: add case 4 (UpdateItem), case 13 (BatchGetItem), case 14 (BatchWriteItem),
  case 15 (TransactGetItems) in rpcHandler
- Batch operations use item_args_deserialize_list() for count-prefixed ItemArgs
- UpdateItem stores value directly via engine.put after receiving it from control plane
- docs/API.md: comprehensive DynamoDB-compatible API reference with request/response examples
- docs/adr/001-dynamodb-api-gaps.md: ADR documenting design decisions for new operations
- Validate UpdateExpression has SET/REMOVE/ADD keyword before parsing
- Add type guard in setJsonAttribute to prevent ClassCastException on scalar intermediate nodes
- Remove dead SS/NS branches from addJsonAttribute (never triggered since node is already a DynamoDB wrapper)
- Remove unused 'unprocessed' variable in handleBatchGetItem
- Document UpdateItem atomicity limitation in ADR
- Add 13 new unit tests for UpdateItem, BatchWriteItem, TransactGetItems, DeleteTable, DescribeTable, ListTables
- Add type guard to removeJsonAttribute to prevent ClassCastException on scalar path nodes
- Add null check for TableName/Key in handleTransactGetItems to prevent NPE
- Fix BatchGetItem response format: Responses is now a map {tableName: [items]} instead of flat array
- Add UnprocessedKeys placeholder to BatchGetItem and BatchWriteItem responses
- Fix TransactGetItems response format: wrap items in {"Item": ...} per DynamoDB spec
- Implement ReturnValues for UpdateItem: NONE (default), ALL_OLD, ALL_NEW
- Update tests to use ReturnValues: "ALL_NEW" since NONE is now the default

@poyrazK poyrazK left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay to merge

@poyrazK poyrazK merged commit 5df1e93 into main Jun 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant