I'm the DB maintainer for Drupal 7, and we rebuilt our entire DB layer
on top of PDO.  It's a rather nice API, although as others have noted it
does not abstract away SQL entirely; it abstracts the API calls you need
to use to get to SQL.

We then built a layer on top of that which does abstract away most
database weirdness using fluent query builders.  It's much
lighter-weight than an ORM.  I'm in the process of spinning it off as a
stand-alone library because we think it's that cool, but it's not
completely divorced from Drupal yet.  Stay tuned. :-)

Larry - how many databases does it actually work with? Having rebuilt the DB layer using PDO did you actually gain anything?

Sam - The situation on database abstraction is not clear cut and a lot of tangents have been generated while the traditional approaches are still the best in many cases.

As has been said ... if you only intend to use on database, then use the matching driver and work the SQL in a manor that works for you with that database.

If you need a full range of databases supported, then ADOdb is STILL the best option, and will quite happily use a PDO or generic driver internally depending on your choice, but which ever you use ( and the generic ones still tend to be faster especially with the accelerator package ) the abstraction of the SQL is much more important then simply managing a few data conversions. ADOdb will build tables across the whole range of databases it supports from a single 'profile', while PDO needs a lot of help to do the same, preferring instead to have separate 'profiles' for each database each hand coded.

PDO still needs a number of areas finishing before it can become a total replacement for the legacy stuff that is available such as the PEAR libraries and the likes of Drupal writing their own abstraction layer on top of it ... along with a number of other projects who are now doing the same thing ... shows that PDO is not creating the common platform it was supposed to :(

Lester Caine - G8HFL
Contact -
L.S.Caine Electronic Services -
EnquirySolve -
Model Engineers Digital Workshop -
Firebird -

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to