Note:

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

DB layer 2.0: Difference between revisions

From MoodleDocs
Line 30: Line 30:
* [http://docs.google.com/Doc?id=dgzf39jp_5fv3j3jd7 MDM-20080508 Dmllib 2.0] - Penny, Petr, Nicolas and Eloy.
* [http://docs.google.com/Doc?id=dgzf39jp_5fv3j3jd7 MDM-20080508 Dmllib 2.0] - Penny, Petr, Nicolas and Eloy.
* [http://docs.google.com/Doc?id=dgzf39jp_7tmcr5jc5 MDM-20080513 Dmllib 2.0] - Penny, Petr, Nicolas and Eloy.
* [http://docs.google.com/Doc?id=dgzf39jp_7tmcr5jc5 MDM-20080513 Dmllib 2.0] - Penny, Petr, Nicolas and Eloy.
*[http://docs.google.com/Doc?id=dgzf39jp_11fdj3jhg8 MDM-20080515 Dmllib 2.0] - Penny, Petr, Nicolas, Martin and Eloy.
* [http://docs.google.com/Doc?id=dgzf39jp_11fdj3jhg8 MDM-20080515 Dmllib 2.0] - Penny, Petr, Nicolas, Martin and Eloy.
* MDM-20080522 Dmllib 2.0 - Penny, Petr, Nicolas, Martin and Eloy.
* [http://docs.google.com/Doc?id=dgzf39jp_12hmwjmzfq MDM-20080522 Dmllib 2.0] - Penny, Petr, Nicolas, Martin and Eloy.
* MDM-20080526 Dmllib 2.0 - Penny, Petr, Nicolas, Martin and Eloy.
* MDM-20080526 Dmllib 2.0 - Penny, Petr, Nicolas, Martin and Eloy.



Revision as of 22:39, 22 May 2008

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.


Objectives

  • Switch to prepared statements - using placeholders and preparing statements protects against sql injection
  • Remove the need for data to be add/strip slashed all over the place in the code.
  • Enable easier and productive unit tests.

Requirements

  • 100% cross-db
  • OOP implementation:
    • Full abstraction: Hide underlying libraries (adodb, pdo...) and drivers to Moodle developers completely.
    • Make it so that the database object can be subclassed - this means for unit tests that want to test database access, the test framework can override necessary methods
    • support ? and :param and $1 parameter types
    • global $DB
    • profiling, logging and exceptions
  • Easy to use (consistent and similar to current dmllib 1.0)
  • Easy to migrate (provide documentation and utilities to help on that)
  • Complete unit testing (self)
  • Easy unit testing (moodle - real and mockup)
  • Well documented (PHPDocs + use examples)
  • Tasks, bugs and progress tracked in MDL-14679
  • Due date: N/D

Meetings

Ideas