aws / aws/aws-sdk-java-v2

Add support to pass in variables to the DynamoDB Enchanced Client Extensions

Aperta
#3,218 1 commento 25 reazioni 0 assegnatari Vedi su GitHub
dynamodb-enhanced feature-request p3
Lingua principale
Java
Stelle
2.6k
Fork
1k
Merge medio
2g 9h
PR unite (30g)
51

Descrizione

### Describe the feature

I was using the brand new feature provided by this previous pull request.
- https://github.com/aws/aws-sdk-java-v2/issues/2292

Currently, the DynamoDbEnhancedClientExtension context object doesn't provide any additional context on an update/put operation besides the item being modified.

The lack of ability to pass in external variables into a client extension makes certain use cases of UpdateExpressions impossible without resorting to workarounds. This is doable in the non-enhanced client as I'm able to create update expressions in-line.

### Use Case

My specific use case is to decrement an unmapped value from my DynamoDB object using the UpdateExpression. Because my value is not mapped to my table schema, I'm unable to have visibility to the field in the scope of my custom extension documentation.

### Proposed Solution

A few ideas:
- A dirty solution would be to allow for visibility of DynamoDB attributes marked as @DynamoDbIgnore to be visible in the DynamoDbExtensionContext.items map. Currently, the itemsMap passed into the context only contains DDB-mapped attributes.
- A better solution would be to allow access to the attribute names/value maps defined at the time of performing the put/update operation in the context (extension runtime).
- Finally, a third solution would be to allow for inline update expressions at the time of creating an update on an item. This would need to be added to the regular update request, batch update request, and transact update request. This might work well with the proposed idea of having one-time update expressions as explained in the blog post here https://aws.amazon.com/blogs/developer/using-atomic-counters-in-the-enhanced-dynamodb-aws-sdk-for-java-2-x-client/

### Other Information

As a workaround, I've added a mapped attribute to the database that I am using solely for the purpose of gaining visibility into the extension. While this works fine, it is added a constantly updated and otherwise, redundant, attribute to my schema.

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS Java SDK version used

2.17.196

### JDK version used

corretto-1.8.0_332

### Operating System and version

macOS. Monterey 12.4

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by reading the DynamoDbEnhancedClientExtension context and the put, update, batch update, and transact update request paths mentioned in the proposal. The issue presents several competing API options but names no files or tests; clarify the intended design first, then define completion around external variables being available to extensions without a redundant mapped attribute.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
databases
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.