-
Notifications
You must be signed in to change notification settings - Fork 51
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
Chain-ify remove
#22
Comments
What's the use case for |
Yea, my main reason for wanting them would be setting up/tearing down tests. I could also see it coming in handy for a "delete my account" type of functionality. |
I'd just create/destroy the database for setup/teardown (normally a lot less work 😉). I would think delete my account would be able to just use |
Creating/destroying the database always seemed a bit extreme but it'd probably be a lot cheaper (depending on the size of the table). But yea, aside from testing, let's say that the user has a collection of posts associated with their account and you want to make it such that deleting the user results in the deletion of all the posts. You would need to use |
@ApeChimp
I'm going to need
Table.remove
tomorrow so I'll probably have a go at getting it to resembleTable.find
tonight. My thoughts, for your consideration:I don't want any mishaps with
remove
. As a result, I thought that all remove calls could take one of the following forms:Hash Tables
users.remove().one().hash(id)
users.remove().all()
Hash/Range Tables
posts.remove().one().hash(user_id).range(timestamp)
posts.remove().some().hash(user_id)
posts.remove().all()
Any deviation from this (such as providing a range key on a
some
call) will result in the function throwing an error.This function is going to be a bit more involved than
find
becausesome
andall
will have to use aquery
orscan
and abatchWrite
operation, which can be a bit of a pain. Luckily, I already have these functions inWhen-DynamoDB
, so I should be able to just port them over pretty quickly.The text was updated successfully, but these errors were encountered: