30,997
edits
Tag: 2017 source edit |
Tag: 2017 source edit |
||
| Line 335: | Line 335: | ||
==Using Database triggers== | ==Using Database triggers== | ||
Using Database triggers is not allowed into the code of Dolibarr, so you should have no troubles with Database triggers. | Using Database triggers is not allowed into the code of Dolibarr, so you should have no troubles with Database triggers. | ||
Database triggers are not portable. Compatibility may be broken when upgrading your version of your database | * Database triggers are not portable. Compatibility may be broken when upgrading your version of your database | ||
There is tons of | * Database triggers are often forgotten into backup tools | ||
Using Database triggers can save you time when you make development but is a very bad practice, so is forbidden as it is not compatible with the high level of quality of code expected by Dolibarr team. External modules that uses Database triggers may also be refused on the market place since it won't work for more than 50% of users. | * Database triggers need special permissions that you may not have (and should not have) on a common secured database | ||
* Database triggers means also that you include some "business rules" of your application into the database where most other rules are managed by the code itself (this can create conflict or code that can't be debugged with a step by step debugger) | |||
* Database triggers execute code using the timezone, the default language of the database instead of the reference timezone of the application that may be different (generating offset into database) and the default language setup in application ... | |||
* There is tons of reasons why we do not recommend to use database triggers in your own development. | |||
Using Database triggers can save you time when you make development but is a very bad practice when quality, portability, security and sustainability are priority, so it is forbidden as it is not compatible with the high level of quality of code expected by Dolibarr team. External modules that uses Database triggers may also be refused on the market place since it won't work for more than 50% of users. | |||
==MySQL-MariaDB specificity== | ==MySQL-MariaDB specificity== | ||