nestorrente / erdiagram

Entity-Relationship diagram code generator library
MIT License
49 stars 14 forks source link

Three levels of modeling #1

Open suntong opened 1 year ago

suntong commented 1 year ago

There are three different levels of modeling, like below. The most helpful one is obviously the Physical one, but when the database is huge, a couple of hundreds of tables is just so normal these day, the more abstracted forms will be more preferable, as the number of tables grow.

Machine generated diagrams are the perfect solution for such problem, and hope erdiagram can support different levels of diagrams someday.

Thanks

Conceptual

ClipCapIt-140625-111749.PNG

Logical

ClipCapIt-140625-112254.PNG

Physical

ClipCapIt-140625-112702.PNG

nestorrente commented 1 year ago

Hi @suntong! Thanks a lot for being interested in this project 🙂

Currently, ERDiagram supports only logical diagrams, but it will be super easy to add support for conceptual ones. Regarding physical ones, that will require a bit of refactoring, because now the diagram generators are receiving the ER model, and they will need to use the database model.

I'm quite busy right now, but I will try to add support for at least conceptual diagrams during this month (not only to the ERDiagram library but also to the playground and CLI).

Thank you so much for the idea! 😀

suntong commented 1 year ago

Oh, thanks for the reply.

I refined my OP to make it more clear about the end goal.

As for the physical one, the is image is only a borrowed one -- the key point is to contain all fields, which has already been implemented. But feel free to add anything else at much later time.

nestorrente commented 1 year ago

Hello @suntong!

I added a new diagramLevel option to both PlantUML and Nomnoml diagrams. Currently, it's only possible to choose between conceptual and logical, and the only difference is that the first one doesn't include any field of the entities.

As I said before, at the moment it's not possible to create physical diagrams, as the diagram generation components don't have any DB-related information. I will keep this issue open, as this is something that I'd like to include someday in the future 🙂.

I made the change in both the library and the playground, and I will add it to the CLI as soon as possible (even when the CLI is kind of experimental and I'm pretty sure that nobody is using it 😅).

Thank you again for your interest!