Mar 09
26
Introducing ClayDB
The last several weeks I’ve been looking for a DBAL that fits the Clay Framework best. I was leaning toward the ORM models, specifically Doctrine and Propel. While I like the idea behind ORM, I don’t like the way it has to be implemented right now in PHP. It will get better moving forward from PHP 5.3, but licensing has also been a concern. Clay will be released under the MIT license, which is better for the community, but harder to maintain from a developer standpoint. I like Creole, but it doesn’t fit well into the way Clay handles everything else. These and some performance concerns have nudged me onto a path to develop a new DBAL.
ClayDB will be independent from the Clay Framework, therefore it can be used in other projects without any modifications. It will include a Data Dictionary, for creating database tables, and interfaces for adding new adapters/drivers. Initially it will only support MySQL, from the mysql extension, and I plan to add support for mysqli and pdo_mysql early on. I’ve just begun the planning stages for ClayDB, so I don’t want to go into any details just yet. Primarily I want a DBAL that can take away from the monotony involved with database querying and get rid of as much code replication as possible for APIs. I also want to use interfaces that will allow a smooth transition to ORM, once PHP can handle it correctly.
So that’s where we are right now. I’ll try to get some example code up soon to show it in action.