This content of this page has been updated and migrated to the new Moodle Developer Resources. The information contained on the page should no longer be seen up-to-date.
Previous versions were using adodb abstraction partially encapsulated by old DML api. The database drivers are now fully separated from the rest of code and it is even possible to create new native drivers that do not rely on adodb abstraction anymore.
At present there are three native drivers - mysqli, pgsql and unfinished Oracle driver. The benefits are:
- more optimised and probably faster
- consume less memory
- better possibility to improve logging, debugging, profiling, etc.
- less code, easier to fix and maintain
- and more
Please note old adodb based drivers will be removed before the branching of 2.0.
New native DML drivers support logging of database queries to database table. Logging can be enabled in config.php
$CFG->dboptions = array ( 'dbpersist' => 0, //'logall' => true, 'logslow' => 5, 'logerrors' => true, );
- logall - log all queries - suitable only for developers, causes high server loads
- logslow - log queries that take longer than specified number of seconds (float values are accepted)
- logerrors - log all error queries
- add more info here
- add separate docs pages for each driver - describe all options there