SQLite Support In xPDO 2.0
Notes and Progress on xPDO support for SQLite3
I’ve restarted work on SQLite support for xPDO, and things are looking good so far. This will be targeted at PHP 5.2’s PDO driver for SQLite3, not the older sqlite2 PDO driver included with PHP 5.1.x that is no longer available via PECL. It may be easily adaptable however.
Several adjustments to the domain model will be necessary, but should not affect backwards compatibility with previous xPDO releases at all. Mostly just re-arranging the implementations of certain methods, typically moving them to the engine-specific classes.
I’ve already completed at least the majority of reverse-engineering functionality for SQLite3, including refactoring the
xPDOGenerator::getPhpType() method to use
xPDOManager::$dbtypes as regular expression patterns instead of an array of exact matches. I’ve also made xPDOGenerator an abstract class now, as there is no purpose to instantiate the domain class itself, just the engine-specific derivatives.
Forward-engineering would normally then just work, though I am also now refactoring the schema slightly. For a while now, I’ve known the schema needed to define indexes as separate elements in the objects, rather than being defined in the field definitions. So that change is now being tested on both the new SQLite code, as well as regression tested with MySQL.
Once that is done, it’s off to the races with the core xPDOObject implementation for SQLite to finish off the work.