Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

XMLDB modifying DML functions

From MoodleDocs

XML database schema > Roadmap > Modifying DML functions


Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.


Intro/explnation here...

All the work will be performed in one branch, call it MOODLE_17_DB_DML. This point must be performed after Point 1: Splitting datalib.php was finished.

Details

This is a long process in which a lot of scripts become affected although critical changes are, exclusively in the DML functions. The rest is a repetitive work, changing how such functions are used in hundreds of places and testing them carefully. Documentation of the new final DML library must be ready as soon as possible to allow 3rd part developers to update their contributions.

Following, there is one list of changes to be performed in the DML library with their implications in the rest of the code (note: as the number of changes isn't too much big, move each item to one section!)

  1. We need to change all the uses of the LIMIT offset, num clause to use the cross-db compatible SelectLimit() function. Two alternatives seem possible:
    1. Create a new set of get_records_limit() (and get_recordset_limit() ?) functions, allowing to specify the offset, num parameters.
    2. Modify the current get_records() (and get_recordset()) functions to allow two more optional parameters (offset, num)

Timeframe

See also