datalib.php is dead. Long live the new libs

datalib.php is dead. Long live the new libs

Eloy Lafuente (stronk7) -
回帖数:8
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像
Hi moodlers,

since some minutes ago lib/datalib.php has changed dramatically. 惊讶

It has been divided in three parts:

* lib/dmllib.php: Where all the select/insert/update... functions will reside (DML functions).
* lib/ddllib.php: Where all the table/field/index creation/drop... functions will reside (DDL functions).
* lib/ddllib.php: Where all the functions not being DML/DDL will remain until they were moved to other libraries/stuff (legacy library).

This radical change is part of the XML database schema thing, coming for Moodle 1.7.

In a few days, some changes will be performed to both the DDL and DML libraries in order to be able to work against some more RDBMS (MSSQL and Oracle are our goals for 1.7. - apart from MySQL and PostgreSQL, of course 眨眼 ).

You can find more information about the whole thing and all its implications in the above link. At the time of writing this, both points 1 &3 in the Roadmap have been completed and our next objectives are points 4 and 5 in that document.

With them finished, both installation and upgrade of Moodle will be DB-cross-compatible and we'll be able to run against/under 大笑 the new RDBMS and focus all our efforts on point 2 (all the DML modifications needed to be performed in a lot of scripts to work properly against any DB).

I would recommend you to learn a bit more about the XMLDB thing because, in one week from now, if nothing serious prevents/delays it, the install/upgrade process will be replaced (more or less, think about it as one transition) by the new one that will use, exclusively XMLDB stuff (exactly now we are in the process of detect all the DDL functions we need to create in order to support any DDL operation against each RDBMS).

Any idea/comment/suggestion/discussion will be welcome. Also, any fix/completion/improvement of the Docs would be, for sure, great.

Happy weekend moodlers, we are going to have some really intense weeks from now until 1.7 release. Amazing!

Ciao 微笑
回复Eloy Lafuente (stronk7)

Re: datalib.php is dead. Long live the new libs

Carlos Mação -

In a few days, some changes will be performed to both the DDL and DML libraries in order to be able to work against some more RDBMS (MSSQL and Oracle are our goals for 1.7. - apart from MySQL and PostgreSQL, of course piscar ).

What about Firebird ?

回复Carlos Mação

Re: datalib.php is dead. Long live the new libs

Eloy Lafuente (stronk7) -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像
Yep, and Sybase, Informix, DB2, Derby, FileMaker .... but not for 1.7.

Once MySQL, PostrgeSQL, MSSQL and Oracle are working properly under the XMLDB schema, we'll be able to expand to the rest. Nothing forbids that.

But, knowing the time spent these past months to analyse, compare and design one model able to represent Moodle's DB schema, and viewing the important differences that each vendor includes in their products, it would be a nightmare to add more DBs now.

Ciao 微笑
回复Eloy Lafuente (stronk7)

Re: datalib.php is dead. Long live the new libs

roman d -
Dear Developer's Team!
Your work is Great!!!!
How about oracle in Moodle 1.7, it will be in August-September?
Thanks!!!!
回复Eloy Lafuente (stronk7)

Re: datalib.php is dead. Long live the new libs

Jun Yamog -
Great work Eloy, looking forward to test your new stuff soon.
回复Eloy Lafuente (stronk7)

Re: datalib.php is dead. Long live the new libs

Jun Yamog -
Hi Eloy,

I noticed that you are experimenting on fields being nullable.  Yehey!
回复Jun Yamog

Re: datalib.php is dead. Long live the new libs

Eloy Lafuente (stronk7) -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像
Yep,

with MySQL 5 not allowing default clauses on TEXT columns and Oracle not supporting NOT NULL DEFAULT '' clauses, I've started to play with some well-known fields (TEXT only, for now) to see what could be wrong.

All this is a bit more explained here:

http://docs.moodle.org/en/XMLDB_Problems#NOT_NULL_fields_using_a_DEFAULT_.27.27_clause

I hope that with this "TEXT experience" we'll be able to detect any possible drawback before starting the move of CHAR fields after 1.7. Note that these are CURRENT plans and everything is subject to change.

Ciao 微笑