Skip to content

add implementation for UpdateItem - #34

Open
csongor-halmai-oolio wants to merge 5 commits into
mainfrom
csongor/add-UpdateItem
Open

csongor-halmai-oolio wants to merge 5 commits into
mainfrom
csongor/add-UpdateItem

Conversation

@csongor-halmai-oolio

@csongor-halmai-oolio csongor-halmai-oolio commented Jun 25, 2026 •

Copy link
Copy Markdown

This PR implements the UpdateItem() functionality for DynamoDB. It has a decent amount of unit tests as well.

Summary by CodeRabbit

  • New Features
    • Added UpdateItem support to the write API, allowing updates via optional update expressions and expression attribute values.
    • Introduced UpdateOption helpers to configure DynamoDB return values, condition expression behavior, and capacity/metrics reporting.
  • Documentation
    • Added an UpdateItem README section with an example, including an increment operation and ALL_NEW return values.
  • Tests
    • Added TestUpdateItem covering insert/update, increment behavior, and condition-failure handling.

@changeset-bot

changeset-bot Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 602e6d7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • ✅ Review completed - (🔄 Check again to review again)

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 955cd11b-999e-48fd-bcbc-158795637fae

📥 Commits

Reviewing files that changed from the base of the PR and between f5289bd and 602e6d7.

📒 Files selected for processing (1)
  • interface.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • interface.go

📝 Walkthrough

Walkthrough

Added UpdateItem to the write API, implemented request construction with option helpers, documented usage in the README, and added table-driven tests for update, increment, and conditional-error cases.

Changes

UpdateItem API and coverage

Layer / File(s) Summary
UpdateItem API surface and options
interface.go, update_item.go, README.md
WriteAPI adds UpdateItem, UpdateOption helpers set UpdateItemInput fields, and the README shows an UpdateItem call with WithReturnValues("ALL_NEW").
UpdateItem request flow
update_item.go
Client.UpdateItem builds dynamodb.UpdateItemInput from keys and update expression, applies options, calls DynamoDB, logs errors, and returns output.
UpdateItem table-driven coverage
tests/updateitem_test.go
TestUpdateItem runs table-driven insert, update, increment, and conditional-failure cases, then checks returned attributes or expected error substrings.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding an UpdateItem implementation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as resolved.

@csongor-halmai-oolio

This comment was marked as resolved.

@csongor-halmai-oolio
csongor-halmai-oolio marked this pull request as ready for review June 25, 2026 14:18
Copilot AI review requested due to automatic review settings June 25, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@interface.go`:
- Line 31: The UpdateItem method signature in interface.go references
dynamodb.UpdateItemOutput, but the file only imports the DynamoDB types package,
so it will not compile. Update the imports in interface.go to include the
dynamodb service package alongside types, and keep the UpdateItem return type
and any related references consistent with that import.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 090cc2c0-04e6-4f70-8483-507d95c19f53

📥 Commits

Reviewing files that changed from the base of the PR and between 3016a5d and f5289bd.

📒 Files selected for processing (2)
  • README.md
  • interface.go
✅ Files skipped from review due to trivial changes (1)
  • README.md

Comment thread interface.go
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.

2 participants