Add error to Table.update() without where clause #409
theelderbeever
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
@theelderbeever Ah, I'm sorry for the grief this has caused you. We have something on delete where it won't allow it to run without a where clause, unless you pass >>> await Band.delete()
Exception
>>> await Band.delete(force=True) # This is allowed Perhaps something similar for update? I definitely agree something needs adding to handle this scenario. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As a point of discussion running
await Table.update({"column": "value"})
without a.where
will cause an update on an entire table. While this is a poor developer mistake to make I wonder if it would be wise to have an arg in the the update to dictate behavior of the ORM when performing such a query. Maybe something likeHave multiple options such as
error
,warn
,ignore
. And just have it defaulted. Having made this mistake in production it can make for a very bad evening.Maybe this could exist on
delete
as well?Beta Was this translation helpful? Give feedback.
All reactions