Re: PDO: good, popular?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, December 14, 2010 1:02:33 pm Lester Caine wrote:
> larry@xxxxxxxxxxxxxxxx wrote:
> > 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?

Drupal 6 and earlier supported MySQL and, kinda sorta, Postgres, maybe.

Drupal 7 ships with support for MySQL, Postgres, and SQLite out of the box and 
add-on modules provide support for Oracle and MS SQL, within reason.  So we 
increased our DB support from 1.5 to 5, essentially.

We also gained, as part of the rewrite, untyped prepared statements, 
transactions, and master/slave support (although that's nothing to do with PDO 
per se, just our layer on top of it).  And that allowed us, in turn, to build 
type-safe query builders, support for MERGE queries, and all kinds of other 
fun stuff on top of that.

> 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 :(

That is, sadly, true.  PDO is not a complete and perfect DB library, in part 
because there are few people who work on it, and fewer still who understand 
all of the vendor-specific issues at hand and the vendors have been very slow 
to lend a hand, preferring to work on proprietary APIs.  It's quite 
unfortunate, but I still consider PDO an overall win.

If anyone knows C and wants to make a name for themselves in the PHP world, 
PDO is looking for some heroes. :-)

--Larry Garfield

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux