Trac

Guide to MDB2 Source

Doctrine's DBAL is heavily based on PEAR::MDB2. The idea of this guide is to make it easier to find the corresponding original code in MDB2.

MDB2 is structured similar to Doctrine with core drivers and optional loadable modules. However these modules are named and structured a bit different.

MDB2 Core Driver

This code resides in MDB2.php and the MDB2/Driver directory. Doctrine splits up this code into Doctrine.php and a number of other parts:

MDB2 Reverse Driver

This code resides in the MDB2/Driver/Reverse directory. It covers all aspects of reverse engineering schema objects (like databases, tables, columns, sequences etc).

Doctrine equivalents: Doctrine_Import

MDB2 Datatype Driver

This code resides in the MDB2/Driver/Datatype directory. It covers all aspects of datatypes. This includes generating column definitions and mapping native datatypes to portable datatypes. It also covers dynamically adding new (complex) data types.

Doctrine equivalent: Doctrine_DataDict

MDB2 Function Driver

This code resides in the MDB2/Driver/Function directory. It covers generation of the necessary SQL for function calls like SUBSTRING, NOW and others.

Doctrine equivalent: Doctrine_Expression

MDB2 Native Driver

This code resides in the MDB2/Driver/Datatype directory. It covers all non portable functionality that is specific to a given driver.

Doctrine equivalent: Doctrine_Connection

MDB2 Manager Driver

This code resides in the MDB2/Driver/Datatype directory. It covers all aspects reading out what schema objects exists (listing databases, tables, columns, sequences etc.) as well as creation/modifying/deleting of schema objects (like creating/dropping databaes and tables, altering tables etc.).

Doctrine equivalents: Doctrine_Export & Doctrine_Import