6 ms·
Show HN: Online database diagram editor
Hey all! I released drawDB about a month ago and now it's open source. I hope you find it useful.
If you want to check out the app you can go to https://drawdb.vercel.app/ https://drawdb.vercel.app/ .
Thank you:)
- ttfkam 3y agoHonestly, what I'm looking for is a tool that generates the docs and diagrams for a database from the database schema itself and lays it out cleanly. So far I've found tools that will try to generate a diagram naively even if there are a hundred tables, and I've found tools that make you recreate your structure twice: once in DDL and the second time in docs/diagramming. I want Javadoc with scoped diagrams for relational databases.
- zihotki 3y agoThen you should probably push adoption of markdown for javadoc (1). That and mermaid extension should be a good candidate. Or just use javadoc with an additional md plugin. 1 - https://mail.openjdk.org/pipermail/javadoc-dev/2023-January/005563.html https://mail.openjdk.org/pipermail/javadoc-dev/2023-January/...
- ttfkam 3y agoJavadoc is for Java code. I want something that generates documentation for relational databases, not Java. Hence: Javadoc for relational databases.
- phaza 3y agoMaybe you can use schemaspy? https://schemaspy.org/ https://schemaspy.org/
- ttfkam 3y agoIt's been a while since I looked at SchemaSpy. It has improved a lot since I last looked. Thanks for the recommendation! I wish the layout were a little more polished, but the content/functionality is definitely there.
- breadwinner 3y agoAs long as the relationships are also defined in the DDL, the DDL is the only thing that is needed. You can use an automated diagrammer such as the one in https://visualdb.com/ https://visualdb.com/ It shows tables and relationships graphically, and you can click on a table to see its columns and data types.
- yodon 3y agoAre there any advantages that could come from encouraging a tool like this to emit both SQL and strongly-typed classes representing the data in say TypeScript and C#?
- 1ilit 3y agoI like this. Definitely going on the backlog. This can be very useful.
- Atotalnoob 3y agoLook at something like typewriter. It’s abandoned, but it does exactly this
- datascienced 3y agoIf C# alone is enough then this might be up your alley: https://learn.microsoft.com/en-us/ef/ef6/modeling/designer/workflows/model-first https://learn.microsoft.com/en-us/ef/ef6/modeling/designer/w...
- nirav72 3y agoThis is great! Any plans to containerize this?
- 1ilit 3y agoYep! Hopefully soon
- nikolay 3y agoNothing beats dbdiagram [0]! [0]: https://dbdiagram.io/ https://dbdiagram.io/
- gremlinunderway 3y agoNot open source like OP's
- bdcravens 3y agoThe underlying markup language is, and there's a number of open source renderers https://github.com/holistics/dbml https://github.com/holistics/dbml
- rapnie 3y agoOh nice that you mention that. Didn't find an equivalent open-source web-based diagrammer. I found: - ISC license, renders to SVG: https://github.com/softwaretechnik-berlin/dbml-renderer https://github.com/softwaretechnik-berlin/dbml-renderer - DBML community contributions: https://dbml.dbdiagram.io/home/#who-s-behind-dbml https://dbml.dbdiagram.io/home/#who-s-behind-dbml
- 1ilit 3y agoDbdiagram is pretty op. Actually my initial prototype was very similar to it
- hk__2 3y agoWhat was your motivation for making a different tool?
- 1ilit 3y agoAt first it was mostly for myself just as a learning experience and a project that would go on my resume. I wasn't even planning to open source it until people started expressing interest in it. Now that it's out and there's feedback we can cater to more specific use cases
- matthasfun 3y agoLooks real nice! Clean for sure. First feedback I have is, when you click "Settings" > "Flush Storage" there is no "Hey this button will delete everything you have been working on are you sure you want to do this?" type message to confirm if someone wants to actually flush the storage. I was about 6 or 7 tables deep messing around with it and was looking at settings and kind of absent mindedly clicked that without thinking and everything was gone :D
- 1ilit 3y agoOh god i'm sorry about that. Lol funny enough i mentioned it in a reddit thread today that i need to add a warning
- matthasfun 3y agoLol no worries. It was pure "I don't know what I expected" for the succeeding 2 seconds. Other feedback is that it would be nice to be able to set it to say "I want to design a database in PostgreSQL" and have the available datatypes match that. So I can specify postgres specific things like time with timezone, money, point (for geo data) etc. How do you prefer feedback? Issues in the GH repo?
- 1ilit 3y agoI tried to have the diagrams be independent of the DBMS that's why types that are not supported in one DBMS get mapped to their closest match in another. For example SET gets mapped to an array of ENUM values in Postgres. So money, point, etc. can be easily added and mapped. As for the feedback, thank you so much, I really appreciate it. You can leave it anywhere you find convenient but I think GH would be ideal. It would easier to reference and maybe the community can get involved too :)
- sopooneo 3y agoFantastic. I was literally just looking for something like this. I'm using it now. One thing that may be me getting my brain reversed, but when you set the "cardinality" of a relationship the "1" and "n" markings on the connecting line seem to be reversed?
- 1ilit 3y agoThanks for the feedback! The "1" and "n" labels are assigned first to the foreign key then to the primary key, e.g. if you pick "Many to one" the FK side will be "n" and the PK will be "1". Let me know if you find this unintuitive or if I didn't get the question right.
- sopooneo 2y agoGot it, and that makes sense. Thank you. I couldn't even figure out why I was confused, but then looking at the interface, I think I may have been mixing up the order fields are noted, vs cardinality. https://ibb.co/gWS558v https://ibb.co/gWS558v
- xydac 3y agolooks nice, wonder what would take to hook this to a database connection directly
- 1ilit 3y agoCan see it happening for sure. Perhaps porting it to electron and taking in dbms type and host url for the connection will do it
- MForster 3y agoThis looks great. Would be even better if it lived in VSCode, auto-syncing with my DDL files...
- deleted 3y ago[deleted]
- account-5 3y agoAt first I thought this was drawio: https://www.drawio.com/ https://www.drawio.com/ with which you can generate a schema diagram from SQL. Is this the other way around.
- 1ilit 3y agoIt's meant to support both ways, plus additional finer control over the tables, custom types, and error checking
- victorbjorklund 3y agoOh, this is nice!
- trenchgun 3y agoHave you considered packaging this as a VSCode extension?
- beretguy 3y agoPlease do. I personally won’t use it otherwise.
- larodi 3y agoHaving spent fair amount of time on inf.architectural position, I’d really love these tools to also adapt some sort of markup. Sequencediagram.org being perfect example (and others alike) where it takes seconds to put a diagram that otherwise takes hours to prepare. Sadly I know of no standard and lightweight markup for E/R modelling… Mermaid is good for flowcharts, but we still lack reasonably good one for BPMN and enterprise diagrams. (BPMN.io is great but lacks its own lang)
- nfm 3y agoDBML (https://dbml.dbdiagram.io/docs/ https://dbml.dbdiagram.io/docs/) is the only thing I've seen in this space.
- deleted 3y ago[deleted]
- bastih 3y agoWhat about plantuml - covers a fair bit of ground!
- greggyb 3y agoI have found that diagrams tend not to be worth their effort for data models and ERDs. I spend far too much time either: - working in a visual designer that slows me down Or - fighting the layout engine of a markup language and image compiler with lots of directives to try to get the diagram to lay out anywhere close to reasonably. The most valuable information, to me, is the table schema and the collection of relationships. Toward this end, I use a markdown table of three columns, (Field, Type, Attributes) and a code block with my own shorthand per below: Table[field] -1:N- Table2[field2] Detail[HeaderId] -N:1- Header[Id] All text, no generated pictures. If I need to generate from DDL, that's pretty straightforward. But I can also mock up new designs at typing speed. Diffs are incredibly readable. If I need to make pictures for someone else, I iterate design in a markdown file and then once it's good I will spend the time required to make a picture based off the text. I must admit, I start to question why the pictures are necessary.
- me_bx 3y agoYou might want to mention that it is a "data modelling tool" somewhere in the description text, as some of your target users will definitely use that term to search for such a solution...
- 1ilit 3y agothanks! will do
- jesperwe 3y agoAs soon as you add postgres SQL import this will be my daily driver! (I've been looking for a tool like this many times)
- 1ilit 3y agoI'll look into it, thanks for the suggestion
- gardenhedge 3y agoFor tools like these, I need the ability to save locally to my own device and not have anything saved/sent to the cloud. draw.io is the best example of this.
- kcartlidge 3y agoYou can use the Export as DrawDB and Import Diagram options to save and load locally.
- 1ilit 3y agoyep, this or as json
- 1ilit 3y agoNothing gets sent to the cloud, everything is in your browser in IndexedDB. If you go to Inspect>Application>IndexedDB in the storage section you'll see exactly what gets saved and where
- p4bl0 3y agoThis is awesome I was just looking for something like that. The ability to build the diagram from the SQL source is really cool! Thanks!
- 1ilit 3y agothank you!
- michaelmior 3y agoThis looks great! However, a pet peeve of mine that I always share with my students is that ER diagrams do not have foreign keys. ER diagrams represent relationships with a diamond connected by lines to the related entities. It looks like what this is producing is not really an ER diagram.
- wongarsu 3y agoThe big diamonds are specifically the Chen notation of ER diagrams. Which is popular in academia because that's how Professor Chen first described ER models, but seems pretty unpopular everywhere else because it's not that readable, especially as models get larger. Most people who have to actually use ER diagrams seem to use some variation of the UML notation. And even though it doesn't seem to have a name, OPs version is a pretty straightforward (and imho more intuitive) extension of the UML notation (forbidding N-N relationships and adding the relationship name as a foreign key to the table instead of writing it on the arrow). It's also hardly the first time I've seen it, we just need someone to publish a book that gives it a catchy name. If we want people to actually use ER diagrams, treating the original version from 50 years ago as the only valid way to write them doesn't seem useful. Both science and engineering are about iterative improvement after all.
- michaelmior 3y agoI'm not saying the diagrams the OP is using aren't useful, but I would argue that they are not ER diagrams.
- adawg4 3y agoDoes this look at my database for me or is it for ideation?
- wazbug 3y agoWhat's up with projects using "-io"/".io" in their name but not actually using a .io domain? drawio.com brands itself as "draw.io" but uses .com. OP, why is it "drawdb-io"? Cool project btw :)
- DiggyJohnson 3y agoCool project. Your website is much more detailed than your Github so I'd like to share this for visibility: https://drawdb.vercel.app/ https://drawdb.vercel.app/ Any updates on PostgreSQL import support?
- 1ilit 3y agothanks! yep it's definitely coming. can't promise anything for the coming week but i'll try my best to have it out asap
- zimmund 2y agoLooks very nice! A few things I'd like to see to make it more useful: - Let me pick a database when I start so the data types are restricted to that particular database. This can help down the line with other quirks and particularities of each db. - I'd love to be able to use this and convert it to a model for my ORM (I'm currently using Prisma, but depending on your vision this could expand to other languages and ORMs such as, for example, Django). This would be helpful because I'd be able to jump from design to implementation without rewriting everything as models in my ORM. - The nodes to establish relationships are difficult to click, and several times I ended up dragging the table instead. Consider making them easier to grab. - If I delete a property from the table (in the grid) there's no quick way to undo. A toast message with an undo link would be helpful. - The "delete diagram" option didn't ask me for confirmation and even if I saved my diagram before, it's gone. And this option is dangerously close to "Rename"!