Re: Migrate from MySQL to PostgreSQL
| From: | Alexey Borzov | Date: | Fri, 23 Jan 2004 13:50:15 +0000 |
| Subject: | Re: Migrate from MySQL to PostgreSQL | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-10324@lists.php.net to get a copy of this message | ||
Hi!
Andreas Korthaus wrote:
How could I know if something is emulated? Only from source? I don't use db-specific features, no date/time columns/functions, no triggers, no views, I only use transactions as "advanced" feature. In my application I tried to use no specific functions or syntax, because the portability to the most important RDBMSs is very important. At least I have to support Oracle, DB2, MSSQL and PostgreSQL. But I think I could support every DB PHP supports which supports transactions. If necessary I have to write another driver for (M)DB. But I think I will only have to support the DBs mentioned above.I suggest rethinking your approach then and write a separate database access layer for each database engine. This layer will contain all the SQL needed to interact with the database and you will just call PHP functions from everywhere else. The layer for MySQL will contain a lot of ugly PHP code while the layer for a more advanced RDBMS just some procedure calls. The approach you described makes you code for the lowest common denominator and just use the database as an extremely stupid data store.