Metadata SQL database relationship visualizations (ERDs)


Intro: Ashim here, working with Fraunhofer IWES and working on a metadata database currently

I am working on a metadata database in Python language and using SQLalchemy and SQLite libraries to generate the database structure. I was wondering if some one has experience in making the Entity Relationship Diagrams here from the SQLalchemy data classes / tables?

Also, I would be happy to hear more about the implementation workflows as well. At the moment, I have the following structure:

  • (Skeleton structure of the database)
  • (list of declared input variables to limit user input errors)
  • (some helper methods in python to help in automating the functions)
  • (This is the main script, where I insert, execute, query commands)
  • model.db (This is my SQLite database)

This question was initially posted on the IEA Wind Digitalization thread on Slack, but redirected here due to it’s suitability here.

1 Like

Hi @ashimgiyanani ,

Thanks for posting this here. My answer on Slack was:

I used or (same thing) by importing the create table sql statements. It then needed cleaning up but you can get the screenshot below.
There are other paid online Apps and database work benches. There must be something in Python but I’m haven’t come across it yet.

But @christianj had a better answer which I’m sure he’ll post here.

1 Like

Hi @ashimgiyanani and @stephenholleran, thanks for sharing the topic in this forum. Below is my original response on the Slack channel.

I have worked with the erdantic (erdantic) package in python for drawing entity relationship diagrams (ERDs) from data models. This however requires that you have the data models implemented either as python data classes or pydantic ( models. If you are working in python I suppose you might have something like that. The pydantic package has nice plugins for converting other models to that framework. For example, there is a tool to generate pydantic models from SQLAlchemy models, but I have never tested that myself. The erdantic package can generate Graphviz DOT format files, so if you do not like the visual rendering, you can implement your own one from the DOT files.


@ashimgiyanani I am happy to exchange ideas if you want and would be interested to hear how you get on with it.