fix: UpdateItem with no directives is a no-op upsert by yesyayen · Pull Request #119 · ExtendDB/extenddb · GitHub
Skip to content

fix: UpdateItem with no directives is a no-op upsert#119

Merged
pdf-amzn merged 3 commits into
ExtendDB:mainfrom
yesyayen:fix/update-item-noop-upsert
May 28, 2026
Merged

fix: UpdateItem with no directives is a no-op upsert#119
pdf-amzn merged 3 commits into
ExtendDB:mainfrom
yesyayen:fix/update-item-noop-upsert

Conversation

@yesyayen

Copy link
Copy Markdown
Collaborator

What

UpdateItem with only TableName and Key (no UpdateExpression, no AttributeUpdates) now matches DynamoDB:

  • Missing item: HTTP 200, key-only item upserted.
  • Existing item: HTTP 200, no-op.

Empty UpdateExpression ("") still rejected via tokenize_for (preserves PR #24, commit ef8b94f).

Why

Closes #118

Testing done

Tested against real DynamoDB to confirm the expected behavior, then verified the fix against ExtendDB end-to-end. New tests:

  • 3 unit tests on validate_update_item covering None, Some({}), and Some("").
  • 2 pytest tests in TestUpdateItem covering the missing-item upsert and existing-item no-op.

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • Clippy is clean (cargo clippy --all-targets --workspace -- -D warnings)
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)

Breaking changes

None.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache License 2.0 and I agree to the Developer Certificate of Origin (DCO). See CONTRIBUTING.md for details.

@pdf-amzn

Copy link
Copy Markdown
Collaborator

UpdateItem with only TableName + Key now matches DynamoDB: upserts a key-only item if missing, no-op if existing. Empty UpdateExpression ("") still rejected via tokenize_for.
@pdf-amzn pdf-amzn merged commit 754f307 into ExtendDB:main May 28, 2026
3 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.

[Bug] UpdateItem with only TableName and Key rejected; should be no-op upsert

2 participants