View Full Version : Emulating a database structure

05-16-2011, 03:36 PM
Hi @ all,

i currently work at a project, that needs a partly db redesign, after running for some time.
But already many php scripts are working with the old structure,
so it would be quite some work to update all the old scripts.
In detail, itīs about separating a table, that had quite many columns, in a couple of smaller tables with each containing a part of the rows.

Now my question:
Is there a possibility, to add to a central place (DbAbstractionLayer) a logic, which would transform all sql queries, to make them suitable for the new structure?

For example SELECT queries would be quite easy, since one would simply have to add some joins to it.

But could this logic work for all possible queries?
If yes, how much time would it take to implement?

Kind regards,

05-16-2011, 05:02 PM
You may want to try writing some views against the new design that emulate the old tables. You'd have to change your existing code base to point to the views rather than the old tables but your query logic wouldn't have to change (assuming you can get your views set up properly).