Rename: .update() -> updateAll() when it can affect multiple rows #304
+150
−150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Interested in your thoughts.
This will make it so that:
QuerySingle<T>has.update(as is right now)Query<T>has.updateAll(instead of it being named.update).The idea is that this will it slightly more likely that someone will notice something concerning when write:
instead of:
Granted you'll now also have to write
.updateAllif you have a.whereclause.IMO, it's a bit ugly, and
Allis a bit inappropriate, because it really means update multiple.I think perhaps we should stick with
.update()in both cases, and accept that SQL has sharp edges if you update a table with aWHEREclause :D