How to implement triggers or db hooks ?
Is there a way to know if sql statement got executed successfully or not ? I wanted to run a code when row gets inserted or updated ?
can custom loggers be used to implement the same ?
2 Replies
if there were no errors after running a query it means that statements were executed successfully
or do you mean you wan to run a code after ANY insert/update?
something like post-query interceptor?
Yup. I want to run a code after any insert / delete
I feel there should be hooks like before insert, after inserts. This will make some of things easier and secure. Like hashing a password. Right now I have to make sure that password I’m inserting is hashed, so every function that uses user insert I’ve to do that. Instead if this can be done at every insert / update, as a developer I’ll feel more confident using user.insert wherever I want