Recommend this page to a friend! |
Download .zip |
Info | View files (4) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2002-08-06 (14 years ago) | Not enough user ratings | Total: 1,174 | All time: 3,104 This week: 1,091 |
Version | License | Categories | ||||
dia2sql 1.0 | GNU General Publi... | XML, Databases |
Description | Author | |||||||||||||
There are few programs on Linux to convert UML diagrams into SQL instructions. This way, I decided to write a php class to read a DIA diagram and generate the correspondent SQL instructions to create DataBase. |
|
dia2sql.php Daniel Afonso Heisler IT department - UNIVATES daniel@univates.br 1. Introduction: There are few programs on Linux to convert UML diagrams into SQL instructions. This way, I decided to write a php class to read a DIA diagram and generate the correspondent SQL instructions to create DataBase. 2. Features: DIA (http://hans.breuer.org/dia) is a gtk+ program to create diagrams. It can be used to draw many sort of diagrams, including UML diagrams. However, as the most of programs, DIA generates only the diagram, It doesn't export SQL instructions. The dia2sql.php class is a tool that convert this UML diagram into SQL. As Dia files are saved in XML format, is possible to read these files and create a DataBase structure easily. This first version supports only PostgreSQL. 3. Configuration: In order to use the class the right way is needed to foolow some conventions during the diagram creation. This first version supports only classes (tables) and associations (references). You gotta save the diagram in XML format. 3.1 Classes: - The class name is always the table name. - The table fields are inserted as attributes. - The attributes (fields) can be: '+' -> 'Public': Simple field. '#' -> 'Protected': Primary key; '-' -> 'Privated': Creates an individual index and another one grouped with all others marked with this option. ' ' -> 'Implementation': Creates a unique index grouped with another ones marked with this option and one index to each individual field; - The Option Class Scope is used to define whether the field is a sequence or not; 3.2 Associations: - The references are done with "Associate to UML" option. You must link two fields of tables and show the origin and the target of the relation. It's important to stablish the link of the fields exactly at the points near of each field. 4. Example: Inside the package, there is a file called example.dia that can be either edited by DIA or converted into SQL instructions. In order to execute the program, type: # php example.php A "sql" directory will be created with respective files containing the Database creation instructions. |
Files |
File | Role | Description |
---|---|---|
dia2sql.php | Class | Class dia2sql |
example.dia | Example | Dia example diagram |
example.php | Example | Example file |
README | Doc. | README |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.