Re: New PDO-based DBAL/ORM for PEAR2
| From: | Helgi Þormar Þorbjörnsson | Date: | Tue, 20 Nov 2007 17:07:34 +0000 |
| Subject: | Re: New PDO-based DBAL/ORM for PEAR2 | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-48509@lists.php.net to get a copy of this message | ||
On 11/20/07, Bertrand Mansion <golgote@mamasam.com> wrote:
>
>
> Le 20 nov. 07 à 16:49, Lukas Kahwe Smith a écrit :
>
> > Funny that I managed to port my CMS from MySQL to PostgreSQL in 2
> > hours (mostly fixing reliance on non deterministic group by's) and
> > to SQLite in 3 hours (1 hour was used to add a feature to handle
> > the fact the SQLite by default qualifies joined columns with the
> > table name unless aliased) as it was based on MDB2. I should also
> > mention that the installation tools based on MDB2_Schema needed no
> > alterations. I also did not feel like I was artificially limiting
> > myself. For example one thing that did require custom code was the
> > internal search, which was based on MySQL's FULLTEXT indexes. But
> > that was a minimal amount of work and a tiny addition to the code.
> > Just to set the record straight.
>
> Actually, 2-3 hours sounds quite long to me given the fact that you
> know those databases well and that you wrote MDB2 :) Furthermore, I
> don't think you accounted MySQL Fulltext replacement in your 2-3
> hours neither. A real abstraction would allow a database change in 5
> minutes, just the time it takes to change the DSN.
If you know beforehand that your application will have to work on
> different databases, you choose the SQL you use carefully, then the
> switch is even faster than 2-3 hours. There is no need to use a "slow
> as hell" layer to do this, especially when PDO does most of the ugly
> job.
PDO isn't an abstraction layer at any rate ... it's just a unified way of
using those fun fun database functions, IMHO a proper DBAL doesn't just
abstract out the functions and stop at that but well I suspect Lukas was
doing something rather funky if it took him that long, I've made a app, open
source, that uses MDB2 and MDB2_Schema and supported last time I checked
(been inactive yes) mysql(i) postgre, sqlite2, oci8 and mssql, even heard
someone talk about interbase and all these just configured on installation
and it does use some of those myth and bloat things you talk about, so yes
it's simply a DSN change (tho I do admit the SQL queries had to be made
quite generic to achieve it but that's exactly what a ORM would do unless
you write a per driver thing to optimize the performance )
So yeah, just wanted to fork in to say PDO isn't the cure you think it is,
even tho it could be a part of it :)
- Helgi