xnuinside / simple-ddl-parser

Simple DDL Parser to parse SQL (HQL, TSQL, AWS Redshift, BigQuery, Snowflake and other dialects) ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc. & table properties, types, domains, etc.
MIT License
180 stars 40 forks source link

Generate output for Mermaid, Graphviz, PlantUML or other "graphics" format #134

Open rbanffy opened 2 years ago

rbanffy commented 2 years ago

Is your feature request related to a problem? Please describe. As part of a CI pipeline, it'd be useful to document SQL DDL as ER diagrams. Graphviz, Mermaid, PlantUML are all tools that can output graphics from a textual representation.

Describe the solution you'd like Setting the output format to one of these should do the trick

Describe alternatives you've considered I was about to write my own (https://dba.stackexchange.com/questions/311402/) didn't show any already existing tools.

Additional context N/A

xnuinside commented 2 years ago

@rbanffy hi, interesting topic, what I got quick in the mind, for example, exists: https://dbdiagram.io/ that uses https://www.dbml.org/home/ DBML language to draw ER diagrams. You can import SQL DDL in dbdiagram and it will auto convert to DBML & ER diagram

Screen Shot 2022-06-08 at 2 14 09 PM
rbanffy commented 2 years ago

I was looking at the output code and it wouldn't be trivial to add this - the output module assumes (very reasonably) that the output will be some sort of SQL DDL. Would you mind if I tried?