PDO (was: SQLite API deficiency)

php.internals

Marc Boeren

22 years ago
Hi,
> I'm currently in DB API mode (working on PDO),
I know PDO is slated to be _the_ db-abstraction module from 5.x (5.1?) onwards (which would replace dbx, but that's fine by me: PDO seems to work more or less the same but with a more OO-ish api), but I was wondering if these names bear any relation to the Python DB-API and the Python Database Objects, or if that is more of a coincidence? Also, will there be an complementary SQL-abstraction package for SQL-dialect differences (such as UPPER(value) vs. UCASE(value), or differences in TOP/LIMIT/OFFSET usage)? I have a preliminary package ready (in php-source-code, not c) that is coupled to an OO-ish api for dbx, but is easily rewritable to a more generic version. Cheerio, Marc.

Wez Furlong

22 years ago
It's more like Perl DBI in concept but with a PHP twist; data access abstraction as opposed to database abstraction. Very light weight and will take advantage of PHP 5 OO features to implement lazy evaluation of result sets. Although we discussed a limited amount SQL dialect abstraction at LinuxTag last year, the initial code is not going to do anything about it. You'll see more on PDO over the next week, when it starts to appear in PECL. --Wez.

Lukas Smith

22 years ago
Marc Boeren wrote:
>>I'm currently in DB API mode (working on PDO),
> I know PDO is slated to be _the_ db-abstraction module from 5.x (5.1?) > onwards (which would replace dbx, but that's fine by me: PDO seems to > work more or less the same but with a more OO-ish api), but I was > wondering if these names bear any relation to the Python DB-API and the > Python Database Objects, or if that is more of a coincidence? > > Also, will there be an complementary SQL-abstraction package for > SQL-dialect differences (such as UPPER(value) vs. UCASE(value), or > differences in TOP/LIMIT/OFFSET usage)? > I have a preliminary package ready (in php-source-code, not c) that is > coupled to an OO-ish api for dbx, but is easily rewritable to a more > generic version.
Actually PDO is more an API unification than abstraction layer. Abstraction will best be handled in userland code, specifically a PEAR package should handle this. For this reason I am also involved in the project more from the API perspective then from actual C implementation. Also obviously the current DBAL in PEAR have solved alot of the issues that PDO faces as well. regards, Lukas Smith