question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for update expressions when using the enhanced Dynamo client

See original GitHub issue

The non-enhanced Dynamo client supports atomic attribute incrementing as provided by the UpdateItemRequest.updateExpression. By contrast the enhanced Dynamo client’s UpdateItemEnhancedRequest requires the entire item be provided in order to fully overwrite an existing row. No attribute incrementing supported.

This lack of feature parity leads to situations where the enhanced and non-enhanced clients usage are intermixed in a single project, or even a single class/method.

Describe the Feature

The enhanced Dynamo client should support taking update requests that allow for atomic attribute incrementing, same as the non-enhanced client supports.

Is your Feature Request related to a problem?

Mixing usage of enhanced and non-enhanced Dynamo client usage in a single class/method leads to messier code. Developers will assume that by adopting the enhanced client it should make their interactions with Dynamo simpler, but that isn’t the case in all situations.

Proposed Solution

  • UpdateItemEnhancedRequest should be further enhanced to support update expressions.
  • Or the enhanced Dynamo client can be updated to take either an UpdateItemEnhancedRequest or an UpdateItemRequest object.

Describe alternatives you’ve considered

At this time I either need to ditch use of the enhanced client altogether, or use both clients and add comments to explain why this is necessary.

Additional Context

Ideally, whatever the solution is, would allow me to use the enhanced version of the Dynamo client for all use cases.

Your Environment

  • AWS Java SDK version used: v2
  • JDK version used: n/a
  • Operating System and version: n/a

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:58
  • Comments:23 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
davidemarronecommented, Sep 29, 2022

+1 to implement this issue

3reactions
debora-itocommented, May 20, 2022

Update expressions and atomic counter for DynamoDB Enhanced Client are now available, starting in Java SDK version 2.17.194.

Check out our blog post showing how to use: https://aws.amazon.com/blogs/developer/using-atomic-counters-in-the-enhanced-dynamodb-aws-sdk-for-java-2-x-client/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update specific attribute using UpdateItemEnhancedRequest ...
I am trying to update the counter using UpdateItemEnhancedRequest (using the Dynamodb Enhanced Client. - JAVA SDK 2). I am able to build...
Read more >
Using atomic counters in the Enhanced DynamoDB AWS SDK ...
An enhanced client UpdateExpression consists of one or more UpdateAction that correspond to the DynamoDB UpdateExpression syntax. Before sending ...
Read more >
UpdateExpression (AWS SDK for Java - 2.18.33)
Contains sets of UpdateAction that represent the four DynamoDB update actions: SET, ADD, REMOVE and DELETE. Use this class to build an immutable ......
Read more >
UpdateItemEnhancedRequest (AWS Java SDK :: DynamoDB
software.amazon.awssdk.enhanced.dynamodb.model. ... Defines parameters used to update an item to a DynamoDb table using the updateItem() operation (such as ...
Read more >
Amazon DynamoDB Client :: Quarkiverse Documentation
It supports both key-value and document data models, that enables to have a ... To use the enhanced client, add the quarkus-amazon-dynamodb-enhanced ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found