Entity Relationship Diagram

excitedbox's profile image excitedbox posted 3 years ago in General Permalink

I know this feature has been requested several times over the years and it seems the last time it was mentioned the answer was, there are more important things right now". This was quite a while ago, so I figured I would ask again and offer my help where I can be of use.

I think having the option to create diagrams would be a great feature to bring in more users to HeidiSQL since the options for ERD software are so limited. Especially with the popularity of frameworks like Symfony and Laravel which rely on ORMs and SQL but even though they are diagrammed the same the exported code is different. Symfony alone has been downloaded over 1 Billion times but in addition Doctrine is used with Laravel, Drupal, Typo3, Nette, Zend, and many others.

Since the DB is not created in SQL but either through writing code or generating with the CLI it is quite difficult to keep track of Entities and their relationships especially since the Symfony CLI doesn't support editing entity fields. This creates a huge mess and requires editing/deleting multiple files by hand when making a single mistake, leading to bugs and messy code.

Doctrine is the most popular ORM out there and there is only 1 app to create data models of your app and it costs almost 300 Euros while being terrible and incomplete. This presents a huge opportunity to draw in users who are looking for an SQL manager that can also help them generate their migrations.

Accomplishing this would be very similar to the MYSQL workbench and after generating the SQL code it would be possible to translate into the right format for whichever ORM/DQL. Another option would be to go directly to the selected format from the diagram.

Many of the needed parts could be adapted from the dialogs already present, such as the SQL Table and field, relation dialogs, sql parser and generator.

The only new part needed would be the diagram canvas, while the rest is either an expansion, such as storing an x and y position for each table, or a copy/modifications, like the field types, export definitions.

An EBNF or similar syntax definition could be used to allow the quick addition of different output formats, and there are a few ready to use Delphi options to do this. (Coco/R or Yacc/Lex based)

I have seen some libraries for building ERD diagrams but not in Delphi but if there is maybe that could help us save some work as well.

Sadly I do not know how to program Delphi, but I would be able to help with the export function from the SQL/Diagram to Yaml, XML, PHP Annotations.

Please login to leave a reply, or register at first.