Re: Database Schema Manager
| From: | Wolfram Kriesing | Date: | Fri, 20 Jun 2003 19:33:27 +0000 |
| Subject: | Re: Database Schema Manager | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17598@lists.php.net to get a copy of this message | ||
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()
...
i just had this idea while restructuring DB_QueryTool, and the SQL Renderer stuff, which should also be capable of joining tables automatically, by knowing the relations, which would be done "asking" external classes, such as the ones i mentioned above.
and i can imagine that there will be many more use cases for that.
hth
wolfram
Lukas Smith wrote:
Hi, I am working on separating the Schema Manager in MDB into a separate package. The idea is that the new Manager will actually not require MDB anymore. Instead the main part of the manager is handling array structures that represent a schema. These array structures can be build up one by one, merged, compared etc. Also the Manager can call a parser or a writer to read or write a schema. I intent to provide the following parsers: - XML (old parser) - SQL (new) - MDB (old reverse engineering) and the following writers: - XML (new, used to be embedded in the manager) - SQL (new) - MDB (old default behaviour) There are all sorts of other parser and writers possible (someone else needs to decide if they are feasible enough to be implemented) like: - PEAR DB - WDDX - Excel - PDF - etc. Here is my preliminary work on the API: http://www.backendmedia.com/MDB/Manager/ I don't know yet how to name it. Basically the schema manager does not require MDB by default anymore. Actually it is possible to write a writer and/or parser for any database abstraction layer. So possible names are as follows: DB_Manager MDB_Manager DB_Schema_Manager MDB_Schema_Manager ... Regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07-- Wolfram http://opensource.visionp.de ... authentication system .... http://sf.net/projects/auth