9 ms·
Show HN: Private, text to entity-relationship diagram tool
- davidktr 3y agoThis looks fantastic, exactly what I needed last time I worked with DBs and could not find. Hope to be using it soon.
- verelo 3y agoLove it, is there any way to make it a little more fuzzy. Ie pk works but "primary key" doesnt, uint works, but "integer unsigned" doesnt? Great idea for helping teams communicate.
- ASalazarMX 3y agoIMO I'd rather they kept the syntax strict and simple. Fuzzyness would add unnecesary complexity.
- verelo 3y agoMaybe an auto-complete or auto correct feature, or even syntax highlighting? I just found myself exploring for the right way to type and jumped to the solution of fuzziness which i agree, might not be ideal.
- shizcakes 3y agoWe've been using https://dbdiagram.io/ https://dbdiagram.io/, which also has an open-source markup language: https://github.com/holistics/dbml https://github.com/holistics/dbml
- Fiahil 3y agoEvery engineer I know have been using DBML for a while. Did they fail their market research ? Edit: Damn, it really look like they were copying dbdiagram.io, down to the FK relationship syntax. Not cool.
- bdcravens 3y agoIt does look VERY similar, but I think they tried to make the language a bit more terse. As a said is another comment, I think the slightly additional structure is actually better.
- bdcravens 3y agoI've used DBML and like it as well. There's a small ecosystem of tools that support it, and I think the additional structure with curly brackets makes for fast "eye parsing".
- swyx 3y agoive been a keeping a list of other diagramming tools too https://github.com/swyxio/spark-joy/blob/master/README.md#diagramming https://github.com/swyxio/spark-joy/blob/master/README.md#di...
- chrisweekly 3y agoDude you have all the lists.
- swyx 3y agoyou wont believe #7! on a more serious note, everyone should have a little utility belt of lists, hand curated and intimately known. they are an extension of me at this point.
- huydotnet 3y agowould you mind checking https://chatuml.com https://chatuml.com out to see if it fits your list?
- breadwinner 3y agoAdd Airforms since it has an automatic database diagram display: https://airforms.com https://airforms.com
- npack 3y agodbdiagram is definitely an useful utility. Some of the differentiators would be: 1. Simpler Syntax 2. Fully Local processing (This tool works offline, once you load the original web page) 3. Light weight & fast (the entire project is 20kb in size)
- tempest_ 3y agoI like the markup language and the app looks nice but I just can't comfortably dump database schemas into random web apps.
- chinaman425 3y ago[dead]
- grouseway 3y agoI see the other comment is marked dead now, but seriously why? I'm having a hard time imagining how a schema is viewed as actual intellectual property or a security risk.
- jcoder 3y agoIntellectual property: it represents what kinds of data you maintain, their naming, and their relation. That’s valuable on its own and also points to what your software does. Security: well, see above—knowing what data is stored determines your value as a target. Now is it the _best_ way to target an adversary? Probably not.
- deleted 3y ago[deleted]
- fallingmeat 3y agoneato! anyone interested in a collab on a more generic natural language graph making tool (think GoJS powered by LLM to make SysML diagrams etc). Demo of api here, I cant do front end, it is a weakness… https://grapher.baselines.cloud/ https://grapher.baselines.cloud/ hit me up on linkedin: /in/thenatefisher
- Nzen 3y agoThis needs better instructions for the expected syntax. With nodes a and b, I tried "a -> b", "a to b", and "a hates b". Each complained "{"detail":"AttributeError(\"'str' object has no attribute 'copy'\")","error":"PERM_SRV_ERR"}"
- fallingmeat 3y agoThanks! fixed it now that I'm back from vacay...
- vegarab 3y agoI'm not too familiar with ER-diagrams -- how does this compare to Mermaid? https://mermaid.js.org/syntax/entityRelationshipDiagram.html https://mermaid.js.org/syntax/entityRelationshipDiagram.html
- ASalazarMX 3y agoCompare the examples in the post against the official Mermaid examples[0]. The syntax seems much simpler. 0. https://mermaid.js.org/syntax/entityRelationshipDiagram.html https://mermaid.js.org/syntax/entityRelationshipDiagram.html
- yieldcrv 3y agolpt: ask chatgpt or other sufficient LLMs for catchy domain name variations. I specifically ask for "in web 2.0 style". I crank out short catchy brand names and domain names at far greater efficacy now, steers my thoughts really well if I’m not outright taking the first suggestion verbatim
- graypegg 3y agoJetbrains has their own mermaid plugin they started working on recently, and honestly, I’ve found mermaid to be really all I need. https://plugins.jetbrains.com/plugin/20146-mermaid/reviews https://plugins.jetbrains.com/plugin/20146-mermaid/reviews
- thom 3y agoI've used Mermaid, partly because it integrates well in both GitHub and Notion. It's fine, quite featureful really, but the lack of any ability to control layout properly makes complex schemas quite a mess when rendered. Not sure how others of these declarative, text-based engines deal with that.
- flarg 3y agoUse Mermaid in draw.io. It renders Mermaid into native draw.io shapes that you can rearrange.
- tabulatouch 3y agoI've been looking for such a solution but for class diagrams. Auto generating from code and edit them in draw.io. Do you have any suggestion?
- hackish 3y agoThanks! I was writing a FastAPI/SQLAlchemy+SQLModel/Rocketry app this week and dreaded documenting my model relationships. That said, I see a few SQLAlchemy extensions and Pydantic→Mermaid projects that can probably be used in my case, and that was the route I was initially planning on going down despite none of them being aesthetically pleasing. Many of these online tools reasonably rely on human input to place tables/nodes. Do any of these recommended tools do a decent job of smartly laying out the final diagram?
- digitalsanctum 3y agoI love tools like this (text to diagram) and tend to use mermaid for most things. I also really like draw.io which includes a gui and has integration with GitHub to save diagrams directly to a source repo. Is there a solution that has direct, bi-directional integration with Postgres/MySQL. For example, execute DDL from the diagram or point to an existing db and output the diagram text?
- shinkim0914 3y ago> Generate DDL directly generate SQL statements to create your database tables. Looks like it's capable of turning a diagram to SQL too? That's neat! For those that are interested in an GPT-powered tool, we have a project that can generate diagrams from code of any language or natural language: https://eraser.io/diagramgpt https://eraser.io/diagramgpt
- otto_ortega 3y agoCool tool. My favorite tool for text to model / model to SQL is: https://app.quickdatabasediagrams.com/ https://app.quickdatabasediagrams.com/
- thedangler 3y agoLove to see the javascript behind this. Drawing lines to specific box dot.
- npack 3y agoQBD is a great tool and has been an inspiration (even though we compete)
- sql-spy 3y ago[dead]
- mattdocumatt 3y agoI’m a tech writer and love the idea of “drawing” diagram using the markup. Definitively will try to use it by my another docs project. Thank you.
- sexydev 3y agoI use ERDLab Check it out at https://app.erdlab.io/designer/new https://app.erdlab.io/designer/new Has a lot more cool features for better visual representation like color tagging and search. I also like the ability to create tables/notes using the canvas even though it has DDL support.
- rjbwork 3y agoSince this thread is likely to attract good answers to this... Are there any Terraform-like declarative tools for your schemas that will do a diff and generate a change script? I've seen liquibase and it's just a series of migrations which I think is pretty gross. I really like MS's SSDT tools, but the DACPAC workflow is pretty heavy to operationalize, though doable.
- nerdponx 3y agoPrisma maybe? https://www.prisma.io/ https://www.prisma.io/ It's mostly part of a JS/TS ORM, but it uses a declarative schema language, and there are libraries in other languages to parse and process it. E.g. https://prisma-client-py.readthedocs.io/en/stable/ https://prisma-client-py.readthedocs.io/en/stable/
- jrm4 3y agoWhen I see things like this, now my immediate question is always: what's the underlying model? Is this like a generally open and free thing, with maybe a little bit of monetization to keep the lights on? Then that's great. But, if this is looking to be a big moneymaker? eh, nah.
- sexydev 3y agoAbsolutely right! Everyone launching a beta version of their product says its free. You invest time learning and migrating things over and by the time they catch up on features, pricing page shows up. I have been using https://www.erdlab.io https://www.erdlab.io for 6 months now and so far it looks like they are true to their word. The developers on ERDLab have fulltime jobs and treat it as a side project but still push out updates and handle maintenance in a timely manner. I want them to succeed but not so much where they start to think about making money lol
- npack 3y agoOP Here. I can understand. I would be skeptical too I have been using this tool just for myself for the last few months. The project is intentionally built for longevity (striving to keep the project for decades, if there are serious users). The costs to run are negligible, and I haven't thought much about monetizing. At this point, evaluating if there is enough interest in the tool
- kholdstayr 3y agoIs it possible to resize a table in the diagram? I work on a database that has a column name of "order_module_order_num" and if you try putting that in the text doesn't fit. The text runs into the data type.
- npack 3y agoThe table will expand automatically to fit its contents. So wider columns like order_module_order_num should work just fine
- kholdstayr 3y agoI'm not seeing this at all. Here's a screenshot: https://imgur.com/7T0cLO5 https://imgur.com/7T0cLO5
- deleted 3y ago[deleted]
- kapv89 3y agoGreat ! I am also excited to share ERDTOOL built in this space - https://erdtool.com https://erdtool.com ... - Multiplayer entity-relationship-diagramming tool - think Figma of ERDs - Supports Postgresql and MySQL (mysql part is new homepage hasn't been updated to reflect that) Building it solo. I hope this will also interest the tech community
- allanrbo 3y agodid you consider letting the input be just sql ddl rather than yet another layer of ddl?
- npack 3y agoEvery database has its own flavor of SQL syntax for DDLs. So, we settled on a minimal common syntax. We will have "import" functionality available soon. You should be able to convert database specific DDLs into diagram language.
- dvasdekis 3y agoSuggest checking out the sqlparse library for a way to do the different flavours without needing to address each case directly: https://github.com/andialbrecht/sqlparse https://github.com/andialbrecht/sqlparse
- sbuttgereit 3y agoFrom what I can tell, a lot of these tools seem OK for capturing relatively simple database designs, but at least "look" fairly inadequate for more robust needs. This makes sense if you're trying to use a GUI for creating a database: there's going to be limits to how much you can accomplish easily with that approach so being robust for smaller databases works out. Most of the time I want an ERD tool it's to capture a database that I've already built for documentation purposes, or to document a database that someone else has built and that I need to come to terms with. For this I use SchemaSpy (https://schemaspy.org/ https://schemaspy.org/). I let it reverse engineer the database, build the diagrams, etc. I like the way it organizes what it captures and that it will do things like capture in-database object comments and put them in sensible places; for example, this lets me use the PostgreSQL COMMENT ON * commands to add contextually relevant documentation in the DDL and this tool will do the right thing when I generate database documentation.
- tejtm 3y agoI used SchemaSpy to great effect for many years, till someone decided it was abandoned and took it over. When I tried again it had become shockingly bloated presumably in the name of modernity. I just wrote a one pager for the SQL dialect I was in and moved on. I get that it is java, and bloating is considered normal but as the original author proved, it does not have to be that way all the time.
- sbuttgereit 3y agoThis could well be the case, but to be honest I'm not too concerned by that. So in short, it may not be a well engineered product, but it seems to do its job well enough which is all I really care about as a user. My usage pattern is to run it on a workstation (usually my personal workstation or laptop) and take the result and put it somewhere useful. It's not a perpetually running process or something I'd run on, say, a production machine where any bloat could produce meaningfully negative results. Those results are also not something I'm too worried about for things like bloated web pages or so... at least insofar as the audience for that result is fairly limited and the user experience isn't something I see as hurting usability. Any extra time it takes doing its job because of any inefficiency doesn't really impact me either; once I'm at a point I can set it running on a database, I haven't found it to be terribly long running, I don't run it often, and usually I can just do other stuff while it's running (a few minutes or so). I haven't found anything open source that produces as good a result and its commercial competitors aren't any better in any sufficiently meaningful way... unless you want to start talking about database documentation being integrated into larger, consolidated requirements/documentation tools. If anything I'm pleased that someone did pick up the maintenance and that new database features and the like have some hope of being supported... and without maintenance the result -would- eventually come to suffer as things in the database world moved on.
- mih 3y agoThe issue I have with a lot of these tools is they work fine when depicting relationships between tables in the same schema (talking mainly about PostgreSQL databases), but few support showing relationships between tables across different schemas. Also, when the number of tables grows large, few have layouts arranged in an optimal way. I use D2 (https://d2lang.com/ https://d2lang.com/) to create ERDs. However, of the free layout engines available in D2, Dagre (https://github.com/dagrejs/dagre https://github.com/dagrejs/dagre) and ELK (https://github.com/eclipse/elk https://github.com/eclipse/elk) both don't have optimal placement of layouts for a sufficiently complicated database.
- flarg 3y agoI just today discovered that draw.io auto converts Mermaid to editable shapes in draw.io. The best of both worlds!
- smusamashah 3y agoI am somewhat maintaining a list of text to diagram tools at https://xosh.org/text-to-diagram/ https://xosh.org/text-to-diagram/ (will add this one too) These are two other dedicated tools I have on the list https://app.quickdatabasediagrams.com/#/ https://app.quickdatabasediagrams.com/#/ https://dbdiagram.io/d https://dbdiagram.io/d
- l5870uoo9y 3y agoDo you know of any libraries (TS/JS) for creating database diagrams? I am considering integrating it into my app.
- koch 3y agoThanks for maintaining this list! Unrelatedly, could you do me a favor and update #14 https://cascade.page https://cascade.page to https://markwhen.com https://markwhen.com? I renamed it and moved domains.
- Kwpolska 3y ago1. Why not just use SQL? 2. You should really work on error handling. I went to /app and tried changing the name of the CustomerID column, and nothing happened. I tried changing something else and it didn’t work either. It should tell me that the other table is mentioning a non-existent column and the input is invalid.
- npack 3y ago1. Every database has its own flavor of SQL syntax. So we need to settle on a minimal syntax that can export to any database. (BigQuery, Snowflake, MySQL etc..) 2. I tested it out. When i attempt to change CustomerID it does show a error toast in the bottom saying FK reference is invalid. Not sure, why its not showing up for you. Which browser are you using ?
- Kwpolska 3y agoI'm using Firefox. On my larger screen, the toast did appear, but it was outside of the scrolled-in view. On my smaller screen, the layout just broke and the toast is not visible.
- saadatq 3y agoI love that this is trending on HN. LLMs be damned. We still have lots of “simple” problems to be solved, like how to effectively write and share an ERD.
- Solvency 3y ago[flagged]
- capitanazo77 3y agoCreated this python script to export mysql to this format. Used chatgpt so expect weird code. it works! but dies a little with many tables :-) code: https://paste.rs/1ZHp7.py3 https://paste.rs/1ZHp7.py3 screenshot: https://i.imgur.com/4D2hEWc.png https://i.imgur.com/4D2hEWc.png
- npack 3y agoDefinitely impressive on what you put together in a short time. Long term, we would want to build robust "Import" wizard for every dbms
- Cypher 3y agowhy no dark modeeee ahh
- tessbi 3y agoVery cool!
- manishsharan 3y agoI am using ChatGPT to generate PlantUML Entity Diagrams. I have a separate chat just for this purpose. It can generate the PlantUML and Spring JPA Java code for all my entities. If I need a change , I ask it to update the model and generate updated diagram and code. It also generate Liquibase xml changeset. Moreover, it can also generate my GraphQL schema .. and update it when I change the data model. This is the friggin' holy grail of all diagramming and modeling tools. And it is available and working now. Everything else is just too primitive !
- ElFitz 3y agoOh! I thought this was something about describing a data model in plain text and having an LLM generate the entity-relationship diagram tool. I’ve done this with GPT4, asking it to output Mermaid relationship diagrams. And it’s usually impressively good (never went beyond ~10 entities). I also had it update and fix the result using natural language feedback. I sometimes had to touch up a few things "by hand", but I really wouldn’t bother doing it from scratch myself anymore. Even the failures are interesting, as they often result from an unclear description, or issues in my own understanding of the domain or model.
- sunsetMurk 3y agoditto, GPT-4 is very impressive with all types of mermaid [0] diagrams! even helps w/ styling and formatting tweaks. It's helped me so much with better coverage and maintainability on diagrams for software & systems projects. 0. https://mermaid.live/ https://mermaid.live/
- penciltwirler 3y agojust use dbdiagram.io
- text2db 3y agoSomething similar made by me (text2db) long time ago, cannot maintained it, but if someone wants to continue, code is available on github https://stackblitz.com/edit/web-platform-hxc9oz?file=index.html https://stackblitz.com/edit/web-platform-hxc9oz?file=index.h... https://www.youtube.com/watch?v=8hYtZ38wuz4 https://www.youtube.com/watch?v=8hYtZ38wuz4
- laowantong 3y agoMy own tool adopts a mixed approach to the layout problem : diagram-as-text, but the line breaks and the order of the boxes (entities and relations) are used as position hints. The resulting layout is constrained to an invisible grid corresponding to a left-to-right and top-to-down reading of the source. Moreover, since there are relatively few possible grid positions, automatically rearranging the layout becomes an assignment problem, which can be solved by a simple b&b algorithm. Obviously, this wouldn't scale, but this is just a teaching tool that I use to present small ERDs to my students. You may test it at https://mocodo.net https://mocodo.net. Click the turning arrows symbol to draw the diagram and the shuffle symbol to rearrange it randomly. Warning: French-flavored ERD, aka Merise MCD.
- mfru 3y agofor lighter usage, i am using Database Designer on Android. it is surprisingly easy to use and most of my ideas never come up when i'm on my pc anyway.
- d4rkp4ttern 3y agoAh, diagrams from text. Every few months I look into producing slides, and look for something that saves me from having to use a mouse-intensive tool like PowerPoint or KeyNote, preferably using Markdown. There are plenty of tools to make markdown slides — slidev, Marp (esp w VSCode extension), HackMD, etc. But for diagrams I haven’t converged on a good workflow. Maybe mermaid is worth spending time with.