Hello, "Arcadius A." wrote: > > Hello ! > I'm planning to write a database application for MySQL, and then port it to > PostrgeSQL. > Is there any library or class that could help me to write/maintain just one > source code for both MySQL and PostgreSQL ?
I think your best (if not the only) option in PHP is Metabase. http://www.phpclasses.org/metabase This is a PHP databases abstraction focused on application portability. AFAIK, it is the only one that provide complete and true data type abstraction. This means that for instance if you have to deal with dates in your application, Metabase assures that you only have to deal with a single date format (ISO 9601 - YYYY-MM-DD HH:MM:SS) even if the underlying databases use other formats. So, when you switch to a different database, you do not have to touch a single thing in your application other that the choice of database type option. Metabase goes farther, it also abstracts database schema installation and maintenance. This means that it provides a way to describe a schema of database tables, fields, indexes and sequences using a simple XML syntax. Then the Metabase manager class will install it for you in the target database that you use. If you move to another database, Metabase can export the database contents in the same XML format and then you may reinstall the schema in the new database type without loosing information. Here it is an example of a Metabase schema: http://www.phpclasses.org/browse.html/file/59.html Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php