I have the SQL DDL commands to create a database (CREATE TABLE etc. etc.) with some Foreign Key - Primary Key inter-table constraints.

Now, I want to generate an image which looks something like this:

enter image description here

That is, for every table, there's a listing of its name, its size (or a comment), and its column names (without the type); and single- or multi-column FK-PK relations are marked with an arrow connector, or split-ends arrow connector.

Required features:

  • Gratis
  • Produces either a high-resolution image or some vectorized format

Desired features:

  • Libre license
  • Supports customizing the output format, visually (colors, connector behavior, spacing)
  • Supports customizing the output format, content-wise (e.g. displaying the data types, marking the primary key fields differently)
  • Exports both images, SVGs and Libreoffice Draw / Visio / Dia files


  • It can be web-based, I don't mind.
  • I can adapt my DDL to whichever dialect the tool supports - PostgreSQL, MySQL, MS-SQL, MonetDB, whatever. So the tool can be "fussy". I can even enter the field details and the constraints manually if push comes to shove.
  • Why free? and have you tried mysql workbench? did that fail to meet your needs? – Jon Scott Dec 6 '17 at 17:54
  • @JonScott einpoklum seems to look for a file-based approach, not a tool that connects to a database to reverse-engineer DDL ("I have the SQL DDL commands to create a database"). Can MySQL Workbench do that? – Izzy Dec 6 '17 at 17:56
  • MySQL Workbench - no - you have to create the database and then it can draw the diagram – Jon Scott Dec 6 '17 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.