Re: DB & MDB2 Portability

From: Date: Thu, 02 Mar 2006 06:45:23 +0000
Subject: Re: DB & MDB2 Portability
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23190@lists.php.net to get a copy of this message
On 3/1/06, Paul Scott <pscott@uwc.ac.za> wrote: > I have recently started porting one of our (very) large applications > from PHP4 + DB to PHP5 + MDB2. > > My question is as follows: > > In the PHP4 version, we used MySQL as the primary RDBMS, but in the PHP5 > version would like to give the user the option to use Postgres, Oracle > and MSSQL as well. As far as I can see, things should all be OK with the > different backends, but for one question. Can MDB2 abstract the column > types and names properly? Yes. > I see that there is support for datetime > columns, but not some others, like timestamp, null fields (for Oracle), > booleans, CLOB's, Decimals, etc. > Umm...huh? MDB2 has full support for BLOBs (and I assume CLOBS) as well as dates, numbers, etc. Where are you looking for this? It *may* not be implemented for each of the DB backends, but this can always be improved. > I have looked at an object by Daniel Convissor that does this type of > abstraction correctly, for all of the above quirks (and more). Am I > flogging a dead horse by implementing this as a separate layer in my db > abstraction? or is it still necessary? Could you let us know what this is? > > I have googled for information around this point, but can't find > anything satisfactory. I have also tried looking through the API docs > for MDB2 as well as the code, but could only find a couple of references > to portability, namely in the terms described above. > MDB2 is all about portability, from the case of the field names to the datatypes and all the way up to the schema. MDB2_Schema allows you to specify your schema (and initial data) in an XML format in a DB independant way and it will be handled right on all of the DB backends it supports. It even supports finding differences in schemas and dpeloying updates (IIRC). If you find anything which is not implemented put a feature request into the bug database. Or talk to Lukas and the other MDB2 devs to see if what you're suggesting fits in (and isn't already implemented). Patches are, of course, welcome. ;-) Don't waste your time doing it yourself when most or all of it is done already. -- Justin Patrin

« previous php.pear.general (#23190) next »