I maintain an almost exhaustive list of text to diagram tools [1]. dbdiagram.io requires login to export.<p>Other dedicated text to database diagram tools are<p>1. Database Diagram Tool <a href="https://databasediagram.com/app" rel="nofollow">https://databasediagram.com/app</a><p>2. QuickDBD <a href="https://app.quickdatabasediagrams.com/#/" rel="nofollow">https://app.quickdatabasediagrams.com/#/</a><p>3. ERD Lab <a href="https://app.erdlab.io/designer/guest" rel="nofollow">https://app.erdlab.io/designer/guest</a>
(Requires Login to Export)<p>[1]: <a href="https://xosh.org/text-to-diagram/" rel="nofollow">https://xosh.org/text-to-diagram/</a>
This might be silly, but having tools like that built into MySQL Workbench, alongside both forward and backward engineering (get SQL from model and apply it, or get a model from an existing DB) is one of the reasons why I very much enjoyed working with it: <a href="https://dev.mysql.com/doc/workbench/en/wb-eer-diagrams-section.html" rel="nofollow">https://dev.mysql.com/doc/workbench/en/wb-eer-diagrams-secti...</a> (I might otherwise <i>often</i> prefer PostgreSQL, especially due to the procedural language and transactional DDL), also works fine with MariaDB for the most part<p>In most projects I've seen people just do some generic models (not even proper ED diagrams) and write some SQL migrations to be applied with something like dbmate or Flyway and call it a day, though working on DB schemas feels like one of the areas where model driven development actually makes a lot of sense and feels natural, if the tooling is there! Otherwise you end up with the actual schema and the models you make diverging slightly over time, either due to people forgetting to add stuff, or you yourself missing something. That's also why I enjoy the likes of DbVisualizer for getting a nice overview about what's actually in the schema: <a href="https://www.dbvis.com/" rel="nofollow">https://www.dbvis.com/</a>
I usually go with the FOSS <a href="https://pgmodeler.io" rel="nofollow">https://pgmodeler.io</a><p>Its feature-rich, albeit focused on Postgres. And it's ability to compare database schemas makes updating and applying diffs much easier.
Language 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 it's also not limited to database diagrams: <a href="https://en.wikipedia.org/wiki/DOT_(graph_description_language)" rel="nofollow">https://en.wikipedia.org/wiki/DOT_(graph_description_languag...</a><p>In case someone wished this exists but for something other, or more versatile, than database diagrams, although dbdiagram as a product looks way more polished and integrated
The FLOSS tool <a href="https://drawdb.vercel.app/editor" rel="nofollow">https://drawdb.vercel.app/editor</a> has been here on HN several times. IMHO also does a somewhat better job.
Mermaid is also great<p><a href="https://docs.mermaidchart.com/blog/posts/7-er-diagram-examples-for-database-modeling-from-mermaid-ai" rel="nofollow">https://docs.mermaidchart.com/blog/posts/7-er-diagram-exampl...</a>
While discussing data models, my colleague was sketching tables and their relationships in an editor: table A, table B, columns linking them.<p>He then generated SQL from the diagram and deployed the schema to PostgreSQL.
The schema was shared and reviewed.<p>The tool is <a href="https://dbdiagram.io" rel="nofollow">https://dbdiagram.io</a><p>You can import/export SQL and generate images of your schema.
I made a database ORM editor too: <a href="https://tinspin.itch.io/node" rel="nofollow">https://tinspin.itch.io/node</a><p>Mine is a desktop Java app. that exports XML that then gets converted to SQL (create.sql)<p>and ORM Java sources with the matching SQL queries. No reflection, just code generation.<p>Should work with MySQL (MariaDB), Postgres and Oracle.
Maybe it is me but I never find those relationships diagrams that useful.<p>When structure is obvious then it is obvious and I don’t need a diagram - when structure is convoluted diagram is such a mess anyway that it is not helping at all.
I 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.<p>It can also save the picture as a mermaid text for future edits. Pretty neat.
I have an issue with calling any of the diagrams created by all the tools mentioned "ER Diagrams". Entities are not the same thing as tables, and Sr diagrams are not relational database table diagrams. A (semi) visual representation of a database schema of any size that'd require a visual representation is almost necessarily a mess, and doesn't really help discussion or design. It is at best a faster indexing into the DDL for the tables.<p>What I'd love to have (but never saw an affordable tool) is the ability to work at different levels of abstraction: physical (which is what all tools here actually do), logical (hiding field details, normalization and de normalization, giving better business entity names, etc) and conceptual (to show how big picture concepts relate, domain boundaries, department dependencies/relationships).<p>Just the physical representation does, for my purposes, little more than code highlighting.
Looks cool, but a bit of a bummer it's not open source. These days when I need to sketch out SQL/database diagrams, I usually have an LLM generate Mermaid code for me — good enough for quick drafts.<p>If I want something cleaner or a little more "presentation ready," I switch to d2 (<a href="https://d2lang.com/tour/sql-tables/#basics" rel="nofollow">https://d2lang.com/tour/sql-tables/#basics</a>). It's got really simple syntax and does a great job laying out entity-relationship diagrams without much tweaking.
That is a very nice tool! I might use it.<p>In case it's useful to anyone in here, I wrote a little app at erdraw.com which is specifically designed to be a way to draw a data model in the notation of "Mastering Data Modeling" by Professor John Carlis. It serves somewhat different goals than these other tools. It prioritizes user understandability to be useful in conversations non-engineers. So it excludes technical details like data types and SQL.<p><a href="https://erdraw.com" rel="nofollow">https://erdraw.com</a>
Tooling is a big reason I would reach for SQL Server over alternatives in many scenarios. Combining SSMS with 1-2 RedGate utilities and an Excel license is essentially the one ring of database management.<p>When you have a complex data model and need to constantly engage the business regarding it, having an easy way to transform, compare and visualize representations of the schema can mean the difference between ~3 clicks and a multi-day journey into the rabbit hole of shiny technology.<p>I would still reach for SQLite in any scenario where I am embedding the DB in software that I am distributing. But, if I need to stand up a database that multiple systems and users are all going to talk to, I am always going to advocate for spending a little bit of money.
If you need it for your warehouse (Snowflake/Databricks) - take a look at SqlDBM: <a href="https://sqldbm.com/" rel="nofollow">https://sqldbm.com/</a>
It's really convenient for being able to quickly whip up diagrams to share for discussion. Like when you have a small group of folks that need to iterate on a DB design, it's super simple to change things.<p>I've used this a bunch early in projects where the team needs to agree on DB structure:<p>1. whip something up as a discussion piece
2. usually a quick meeting to iterate on it, spot problems, correct.
3. you're close enough to build the DB bits, ship it. :)
I’ve been using Mermerd [1] for years and never looked back. Simple, does one thing well.<p>It gets even better with elk layout - just prepend this frontmatter snippet to mermerd’s output:<p><pre><code> ---
config:
layout: elk
---
</code></pre>
[1]: <a href="https://github.com/KarnerTh/mermerd">https://github.com/KarnerTh/mermerd</a>
Just for fun you can explain the domain problem to an LLM, then ask it for the dbdiagram json representation. Fix any issue you may spot, then ask the LLM to convert it to Jhipster modeling language (JDL) and import it with the cli. For me that’s the type of workflow that involves AI, rather cursor/windsurf/claude approach.
Is there a way to switch to numerical multiplicities/cardinalities? I always find the circle and feet notation not very readable and also less precise in some cases.<p>My personal go-to tool for this kind of diagram may remain yEd graph editor for now.
I would absolutely love a free tool that compiled SQL into UML suitable for diagrams and visual exploration.<p>BTW, one that did the same for Terraform would make my life so much easier…
insane the number of ways people handle diagrams - honestly i just get lost in all the tool options. you think having too many choices slows progress or actually helps in the long run?