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

Bulk DELETE, restrict full table DELETE without filters #2314

Open
steve-chavez opened this issue Jun 13, 2022 · 1 comment · May be fixed by #2724
Open

Bulk DELETE, restrict full table DELETE without filters #2314

steve-chavez opened this issue Jun 13, 2022 · 1 comment · May be fixed by #2724
Labels
enhancement a feature, ready for implementation http http compliance

Comments

@steve-chavez
Copy link
Member

steve-chavez commented Jun 13, 2022

The DELETE method now has two problems:

  • It allows a full table DELETE without filters - an expensive operation(can take a long time on big tables) and it can occur by accident
  • A DELETE with a big in query parameter(?col=in.(1,2,3,4,5,....)) can err because of URL size limitations.

We can have the same interface as the new Bulk UPDATE for DELETE and solve the above problems.

DELETE /projects

[
  {"id": 1},
  {"id": 2},
  {"id": 3}
]

This would involve having a body for a DELETE method, which seems fine since other well-known APIs do it. There was also a previous discussion in #2125 (comment).

@steve-chavez
Copy link
Member Author

Same idea as #1959 (comment), we could use Prefer: params=multiple-objects; unique_keys=id to avoid breaking existing DELETE requests.

@steve-chavez steve-chavez removed the breaking change A bug fix or enhancement that would cause a breaking change label Feb 13, 2023
@laurenceisla laurenceisla linked a pull request Mar 28, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a feature, ready for implementation http http compliance
1 participant