Home > Archive > PHP Pear > March 2006 > DB & MDB2 Portability
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
DB & MDB2 Portability
|
|
| Paul Scott 2006-03-02, 3:56 am |
| 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? I see that there is support for datetime
columns, but not some others, like timestamp, null fields (for Oracle),
booleans, CLOB's, Decimals, etc.
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?
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.
Could anyone either confirm or deny my findings? I would hate to carry
on re-inventing the wheel if its not useful!
Any pointers would be a great help!
--Paul
| |
| Lukas Smith 2006-03-02, 3:56 am |
| Paul Scott wrote:
> different backends, but for one question. Can MDB2 abstract the column
> types and names properly? I see that there is support for datetime
> columns, but not some others, like timestamp, null fields (for Oracle),
> booleans, CLOB's, Decimals, etc.
By default MDB2 converts empty strings to NULL on insert and when
fetching. There is even a module to abstract function calls.
We just need more documentation. I am pondering donating some money to
get someone to write documentation.
regards,
Lukas
|
|
|
|
|