RE: [PEAR-DEV] Database Schema Manager

From: Date: Fri, 20 Jun 2003 21:52:07 +0000
Subject: RE: [PEAR-DEV] Database Schema Manager
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17603@lists.php.net to get a copy of this message
> From: Wolfram Kriesing [mailto:lists@kriesing.de] > Sent: Friday, June 20, 2003 9:33 PM > i dont know if this is already part of what you will do, but here is > just my idea. > what do you think about splitting off the structure-thing into seperate > packages. what i mean is to put the stuff that describes a db-structure > and each table in a seperate class. > so that you would have i.e. the two packages: > > DB_Structure with i.e. the following methods > getTableNames() > getRelations($table) - returns the relations the given table has to > other tables using foreign keys > getRelatedTables() > getTable($tableName) - returns an instance of DB_Structure_Table > etc. > ... > > DB_Structure_Table - works on one table and provides methods such as: > getColumns() > getType($column) > getIndex() > getPrimaryKey() > ... Well I was thinking about making each of the structure elements (sequences, tables, fields within a table, indexes within a table) classes but I settled on leaving them as array structures for now mainly because it would be more work otherwise. It might be the better route in the long run however. So for now the plan is just that: A parser reads data from a source into the defined array structure. The manager handles modifications to that array structure. A writer outputs the array structure to a given format. If people assist me it might be worthwhile to move to classes to increase the flexibility even more. Then we could move the logic for comparing and building up array structures into those classes. Regards, Lukas

« previous php.pear.dev (#17603) next »