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

Feature: Batch Delete #84

Open
ricky-sb opened this issue Nov 15, 2019 · 0 comments
Open

Feature: Batch Delete #84

ricky-sb opened this issue Nov 15, 2019 · 0 comments
Assignees

Comments

@ricky-sb
Copy link

ricky-sb commented Nov 15, 2019

We have a batch_put operation, but no batch_delete operation. The architecture here might be a bit difficult to integrate.

Here's how I'm currently doing it. In my main class:

items_to_delete = MyModel.query(client_id='test123')
with MyModel.Table.table.batch_writer() as writer:
    for item in items_to_delete:
        delete_item_kwargs = {}
        item._add_hash_key_values(delete_item_kwargs)
        item._normalize_keys_in_kwargs(delete_item_kwargs)
        writer.delete_item(Key=delete_item_kwargs)

I would like to do something like this:

items_to_delete = list(MyModel.query(client_id='test123'))
MyModel.batch_delete(items_to_delete)

and it would essentially be syntatic sugar for that.

@borgstrom borgstrom self-assigned this Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants