Skip to content
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

Allow full table updates again #2414

Closed
wants to merge 8 commits into from

Conversation

laurenceisla
Copy link
Member

@laurenceisla laurenceisla commented Aug 9, 2022

Full table updates where disallowed in 86574c8. This PR brings back that functionality because of the reasons mentioned here: #2195 (comment). This issue is also related, mentions discussions on how to handle bulk updates: #1959

  • Allow full table update
  • Add tests

@laurenceisla laurenceisla marked this pull request as draft August 9, 2022 01:57
@steve-chavez steve-chavez changed the title Allow full table updates Allow full table updates again Aug 10, 2022
@laurenceisla laurenceisla marked this pull request as ready for review August 11, 2022 02:06
test/spec/Feature/Query/PgSafeUpdateSpec.hs Outdated Show resolved Hide resolved
test/spec/Feature/Query/PgSafeUpdateSpec.hs Outdated Show resolved Hide resolved
test/spec/Feature/Query/PgSafeUpdateSpec.hs Outdated Show resolved Hide resolved
test/spec/Feature/Query/PgSafeUpdateSpec.hs Outdated Show resolved Hide resolved
@steve-chavez
Copy link
Member

steve-chavez commented Aug 12, 2022

As it is, the PR causes that the following:

PATCH /table

{"id": 1, "name": "new-name"}

No longer does a full table update(doesn't trigger a pg-safeupdate error if installed) but instead it would update the row with id 1. However if we do:

PATCH /table

{"name": "new-name"}

This would do a full table update because there's no id in the body.

Somehow this feels like surprising behavior to me, the url no longer denotes the operation. It could be very confusing for users.

I still think that bulk patch(also delete) would be more explicit and consistent with underscore operators. However we cannot add a single one like on #2405, we need a consistent design for all <- this could take a while and it'd be better for a next release.


What if we reopen #1959, revert back #2311 and leave bulk patch for the next release?

@wolfgangwalther
Copy link
Member

What if we reopen #1959, revert back #2311 and leave bulk patch for the next release?

Yes, I came to the same conclusion yesterday, after reading through everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants