ramblings on PHP, SQL, the web, politics, ultimate frisbee and what else is on in my life
back

MDB2 racing ahead

The past few weeks there has been quite a lot of activity on the MDB2 familiy of packages. There have been a number of internals improvements that should make the package more robust. We also added a getConnection() method that returns a native connection ressource. While the main reason for adding this method was internal, it may also enable people to do some work on the native API using the same connection as in MDB2.

However more importantly Lorenzo spearheaded an effort to add unit tests for the manager and reverse module. This in turn allowed us to finally tweak alot of the relevant methods. We still need to do some tweaks to the test suite so that each of the test cases is cleanly self contained. But its another showcase of how unit tests help raise the level of quality.

During this effort it became clear that we are going through a world of pain to maintain the idea that indexes and contraints should be handle through the same methods. Therefore we decided to split these methods up, to the point where we effectively had to add a new method for every index specific method we had. We are also likely to start hiding constraints in the listTableIndexes() methods and vice versa, since otherwise the MDB2_Schema package is likely to run into issues.

For now we think we can however get away with not adding a <constraint> tag to the xml schema format that is used in MDB2_Schema. This change opens up the door to also add FOREIGN KEY support one of these days, though we have not really discussed details beyond my brainstorming a while ago.

So it seems we have worked off a ton of items on the todo list. However we are still lacking a unit test for the autoincrement code. I have also not dived into the oracle driver in detail. David needs to catch up a bit with things in the mssql driver. There are still some issues in the pgsql drivers reverse method. Also we have not yet implemented the separation of the listTableIndexes()/listTableConstraints() methods. Oh and we still do not have a getServerVersion() method.