Earlier quoted context omitted.
I found out about mermaid recently and have been using it to make diagrams. How do you use it for data modeling though?
Did you follow the link that the parent poster posted? It's exactly about how to do data modeling with Mermaid.
Found a simple tool for database modeling: dbdiagram.io
31–40 of 76 posts
Re: Found a simple tool for database modeling: dbdiagram.io
#32I have found that ChatGTP and Claude are good at converting a picture of a schema to SQL. So I sketch the schema by hand and the LLM creates the SQL. It can also save the picture as a mermaid text for future edits. Pretty neat.
I had the opposite problem, was given SQL ddl with near 1000 tables and hundreds of constraints, and had to produce the schema map. Ran the ddl and connected it to yEd, and hey presto, schema map!
Instead, consider breaking things down to functional areas and then modeling those - just like how most city thinking is "well get on this main road and then this secondary road will get me to XYZ"
Re: Found a simple tool for database modeling: dbdiagram.io
#33Language in that gif reminds me of DOT, from apt install graphviz which is pretty widely used I think. Various tools I use (including some I wrote or worked on) output to DOT format because it's so simple, and from there you tell the tool to make it into the appropriate format for your pdf report or webpage or so: `cat diagram.dot | dot -T png > diagram.png`. The DOT format is not as simple as dbdiagram though! But i…
Re: Found a simple tool for database modeling: dbdiagram.io
#34Mermaid is also great https://docs.mermaidchart.com/blog/posts/7-er-diagram-exampl...
There are some disadvantages however:
1. The foreign key relationships aren't completely clear
2. The diagram became difficult to navigate in vscode as our schema grew in size
Re: Found a simple tool for database modeling: dbdiagram.io
#35Mine is a desktop Java app. that exports XML that then gets converted to SQL (create.sql)
and ORM Java sources with the matching SQL queries. No reflection, just code generation.
Should work with MySQL (MariaDB), Postgres and Oracle.
Re: Found a simple tool for database modeling: dbdiagram.io
#36I maintain an almost exhaustive list of text to diagram tools [1]. dbdiagram.io requires login to export. Other dedicated text to database diagram tools are 1. Database Diagram Tool https://databasediagram.com/app 2. QuickDBD https://app.quickdatabasediagrams.com/#/ 3. ERD Lab https://app.erdlab.io/designer/guest (Requires Login to Export) [1]: https://xosh.org/text-to-diagram/
I used to query databases and create diagrams from the metadata, but text to diagram just makes little sense to me.
Re: Found a simple tool for database modeling: dbdiagram.io
#37I made a database ORM editor too: https://tinspin.itch.io/node Mine is a desktop Java app. that exports XML that then gets converted to SQL (create.sql) and ORM Java sources with the matching SQL queries. No reflection, just code generation. Should work with MySQL (MariaDB), Postgres and Oracle.
Re: Found a simple tool for database modeling: dbdiagram.io
#38can it export to other graph drawing languages like graphviz or mermaid?
Re: Found a simple tool for database modeling: dbdiagram.io
#39Re: Found a simple tool for database modeling: dbdiagram.io
#40Earlier quoted context omitted.
"A picture of a schema"? What does this mean? And by SQL do you mean DDL?
> "A picture of a schema"? What does this mean? A hand-drawn picture of a database schema. Something like this: https://www.dreamstime.com/stock-images-database-schema-imag... > And by SQL do you mean DDL? DDL is a subset of SQL, so the distinction is moot.
Your linked image shows what appear to be tables, and the little arrows appear to represent entity-relationships between them. But I'm not sure how you'd get useful DDL out of it -- none of the columns have types, no indices, etc.!
Maybe an LLM could sketch out a DDL skeleton from a picture, which someone could use as a starting point?