Language and development rules: Difference between revisions

Jump to navigation Jump to search
m
Tag: 2017 source edit
Tag: 2017 source edit
Line 316: Line 316:


Do not include the IF into your forged SQL request. But use instead $db->ifsql() method to you will make a SQL IF that is compatible with all SQL databases.
Do not include the IF into your forged SQL request. But use instead $db->ifsql() method to you will make a SQL IF that is compatible with all SQL databases.
= Using database Triggers =
Using Database triggers is not allowed into the code code of Dolibarr, so you should have no troubles with Database triggers. External modules that uses Database triggers may also be refused on the market place. Using Database triggers can save you time when you make development but is a very bad practive that is forbidden. It is not portable. Compatibility may be broken when upgrading your version of your database, database triggers are often not included into backup tools, database triggers need 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 creating conflict or code that can be debugged with a step by step debugger, ...
There is tons of reason why we do not recommand to use database triggers in your own development.


==Mysql specificities==
==Mysql specificities==

Navigation menu