-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Adding new delete_all query method to remove records based on query #169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually thinking about this yesterday and how “delete_all” is kind of confusing. Is it deleting all or just a subset?
What do you think about “bulk_delete” or “mass_delete” instead? That way it doesn’t mislead people into thinking it’ll just delete everything
hmm.... I can see how it may be a bit confusing, though, I do feel like Ecto: https://hexdocs.pm/ecto/Ecto.Repo.html#c:delete_all/2 Though, some do break that so maybe we just call it |
Good call. I think delete makes sense. Other orms use it. It’s what the SQL call uses. I like it! |
Also I think we should add delete_all and do a compile time raise that tells people to use delete. That way if people use it they’ll know what to do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to merge nice those last bits are addressed
Fixes #111
Based on how rails works, when you run the
delete_all
method, it'll return an integer, so it's going to be the last thing you run in your query. You can chain all your wheres like normal though.