Skip to content

Add insertOrUpdate(…) or update(…) methods to DatabaseClient #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kotlin-GDE opened this issue Apr 24, 2019 · 1 comment
Closed
Labels
status: duplicate A duplicate of another issue

Comments

@Kotlin-GDE
Copy link

Kotlin-GDE commented Apr 24, 2019

hi

with r2dbc there only insert() method to add new entity, so why not add new method insertOrUpdate (or just save) to insert entity if not exists or update it if already exists

@Kotlin-GDE Kotlin-GDE changed the title R2DBC Suggestion R2DBC Suggestion & Issues Apr 24, 2019
@Kotlin-GDE Kotlin-GDE changed the title R2DBC Suggestion & Issues R2DBC improvement Apr 24, 2019
@mp911de mp911de added the status: duplicate A duplicate of another issue label Apr 24, 2019
@mp911de
Copy link
Member

mp911de commented Apr 24, 2019

DatabaseClient is not an entity-based API. It is primarily SQL-oriented with a possibility to benefit from Spring Data's mapping metadata.

We currently miss update and delete methods because there is no API to express predicates. With #64 we will get these and DatabaseClient receives update() and delete() methods.

If you want insert or update semantics, use R2DBC repositories. SimpleR2dbcRepository gives you exactly that behavior considering Spring Data-specific extensions such as Persistable.

@mp911de mp911de closed this as completed Apr 24, 2019
@mp911de mp911de changed the title R2DBC improvement Add insertOrUpdate(…) or update(…) methods to DatabaseClient Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants