Question

Looking for a way to have 3 artefacts in sync:

  • SQL DDL for creating schema tables
  • Diagram presenting tables, columns and relationships
  • HTML documentation describing tables and columns, at least column name, data type and comment/remark

Ideally, there should be one master format from which the others can be generated. Generating diagrams from other formats usually leads to ugly, not-too-friendly results.

So, is there any tool supporting

  • drawing a schema diagram, allowing me to define comments/remarks on columns
  • exporting SQL DDL for creating tables in DB
  • generating HTML documentation. This is optional, if column remarks can be included in DDL (e.g. "column1 integer, -- my remarks"). Converting DDL to HTML is trivial.

My environment is DB2 9.7 LUW.

Was it helpful?

Solution

IBM DataStudio allows you to generate ER diagram from scratch, or by reverse engineering. IT does not have a sync capability, however it has the option to keep track of your changes.

Also, Data Studio can extract DDL from the database and generate DDL from the current objects.

The HTML generation is not included, but it sounds a very nice feature. However, you can use the COMMENT command in order to include your remarks as part of the DDL.

OTHER TIPS

I tried few tools so I decided to share my experience:

  • MS Visio Professioinal 2010 ; without extensions, you can not export DDL. I tried Forward Engineer Addin, but that lead to very MS SQL specific result. I've heard that some older versions of Visio can export DDL but I couldn't try.
  • IBM DataStudio ; very exhaustive installation (1250 MB), Eclipse based tool. This did the job but felt like overkill.
  • MySQL Workbench 6.1.4 CE ; Handy, responsive tool with reasonable footprint (125 MB). With few minutes try, I had drawn an ER-diagram and exported it as DDL and SVG. And the result was good quality.

My choise is MySQL Workbench. It's open source and seems easy to extend with Python. The next step for me is to see if I can extend it to emit HTML documentation of schema.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top