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

Be able to filter bulk DELETE and GET queries by a list of row IDs #11

Open
dantownsend opened this issue Jan 3, 2021 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@dantownsend
Copy link
Member

Currently, PiccoloCRUD (and hence FastAPIWrapper) allow you to filter by the row ID, but you can't filter by a list of IDs.

For example:

# Currently supported:
DELETE /api/tables/movies?id=1

# Proposed:
DELETE /api/tables/movies?id=1,2,3,4,5

This would be a very useful feature, and would make bulk deletes more efficient.

@dantownsend dantownsend added the enhancement New feature or request label Jan 3, 2021
@sinisaos
Copy link
Member

@dantownsend We can do this similarly to visible_fields. My question is whether we can replace the delete_all method (which is disabled by default with allow_bulk_delete is False) with delete_bulk method or delete_bulk method must be separated, with a separate endpoint? If we can replace delete_all (I already wrote working code) we can set allow_bulk_delete to True because there is no longer a chance for user to delete all records, but only the results whose id is in the query params. For example:

DELETE /api/tables/movies/?__ids=1,2,3,4,5  (only rows with id is in __ids will be deleted)

@sinisaos
Copy link
Member

sinisaos commented Nov 8, 2021

@dantownsend What do you think of this idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants