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
Andrii Sherman
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?
Shubham-Sinha
Shubham-SinhaOP2y ago
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
Want results from more Discord servers?
Add your server