3 ms·
Maybe I'm a sadist, but I love triggers. I can easily compare old and new values with them and call functions that also can do comparisons and if statements.
by candiddevmike 5y ago
Maybe I'm a sadist, but I love triggers. I can easily compare old and new values with them and call functions that also can do comparisons and if statements. Can I do all of this in query? Maybe, but it would look very ugly (especially if I forego the functions too). I only have one app interacting with the database, but if I had more the triggers would enforce data consistency too.
Triggers are hard to trace, I'll give you that. I try to test them pretty thoroughly via application unit tests though.
- ranguna 5y agoI 100% agree with you in all points. Triggers are incredibly useful and we shouldn't be scared of them, we should be careful though.