feat(api): complete DynamoDB API gaps (UpdateItem, Batch, TransactGet, Table ops)#6
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Files Changed
Operations Now Supported (was 7, now 14)
PutItem, GetItem, DeleteItem, UpdateItem, CreateTable, Query, Scan, TransactWriteItems, TransactGetItems, BatchGetItem, BatchWriteItem, DeleteTable, DescribeTable, ListTables