awslabs / awslabs/rds-data-api-client-library-java

Collection of DTOs as input parameters

Aperta
#11 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
21
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi Team,

The library supports var args to pass multiple objects:
```
var account1 = new Account(1, "John");
var account2 = new Account(2, "Mary");
client.forSql("INSERT INTO accounts(accountId, name) VALUES(:accountId, :name)")
.withParamSets(account1, account2)
.execute();
```

If we need to pass Collection we have to call toArray():
```
List accounts = List.of(new Account(1, "John"), new Account(2, "Mary")....);
client.forSql("INSERT INTO accounts(accountId, name) VALUES(:accountId, :name)")
.withParamSets(accounts.toArray())
.execute();
```

Batch saving quite often is used with a list of objects and it would help to avoid extra call toArray().

Could you please add overloaded withParamSets method or a new method to pass java.util.Collection, for instance:
```
List accounts = List.of(new Account(1, "John"), new Account(2, "Mary")....);
client.forSql("INSERT INTO accounts(accountId, name) VALUES(:accountId, :name)")
.withParamCollection(accounts)
.execute();
```

Thank you.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by locating the withParamSets entry point and its existing varargs handling. Review its callers and tests, then support java.util.Collection input while preserving the current varargs behavior; done means a collection can be passed directly for batch execution.

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

Valutazione

Stack tecnologico
java
Ambito
database
Tipo di issue
Funzionalità
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.