aws / aws/aws-sdk-java-v2

Support different naming strategies for DynamoDB attributes in enhanced client

Aperta
#5,765 3 commenti 15 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

My understanding is, by default, the enhanced DynamoDb client will assume your attributes are named like your variables which happen to be camel case. If you want your `createdAt` field to be stored with attribute name `created_at` you either have to use an annotation to overwrite this field individually or use the TableSchema builder to explicitly define all your fields attribute names.

I’d prefer something like Jackson where you can set the naming strategy to be camel case, upper camel case, snake case, kebab case, etc.

### Use Case

This would be useful as I don’t think there is a standard for attribute name style and the AWS blog / docs are also inconsistent (but consistent within an example), but the sdk forces you into something if you don’t want to write more annotations.

### Proposed Solution

The TableSchema.fromClass or fromBean method accepts configuration for what naming strategy to use, similar to configuring Jackson’s ObjectMapper.

### Other Information

_No response_

### Acknowledgements

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

### AWS Java SDK version used

Latest

### JDK version used

17

### Operating System and version

macOS

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia individuando i punti di ingresso TableSchema.fromClass e fromBean dell’enhanced client, quindi esamina come vengono attualmente derivati e sovrascritti i nomi degli attributi. Confronta le strategie richieste camel case, upper camel case, snake case e kebab case con i percorsi di configurazione esistenti. Il lavoro è completato quando i chiamanti possono configurare una strategia di denominazione senza dover nominare esplicitamente ogni attributo e il comportamento è coperto dai test pertinenti.

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

Valutazione

Stack tecnologico
aws, java
Ambito
databases
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.