Live data from Hacker News

Free SQL→ER diagram tool, runs in the browser, nothing uploaded

sqltoerdiagram.com

41–50 of 81 posts

Re: Free SQL→ER diagram tool, runs in the browser, nothing uploaded

#41

100/10 for mobile usability. Panning, Zooming, selecting and moving was so seamless I thought I was tripping out.

The whole code base is a breath of fresh air to be honest: https://github.com/royalbhati/sqltoerdiagram/blob/main/src/m... Author is top notch in my book. I'm a sucker for someone taking a complex problem and distilling out a simple solution. I don't know of higher praise to give a developer.

For a hot second I thought we were looking at glorious jquery until I saw this line at the top

const $ = (id) => document.getElementById(id);

Re: Free SQL→ER diagram tool, runs in the browser, nothing uploaded

#43
post #21
post #17

Earlier quoted context omitted.

Thanks and I will add this to my todos!

A few years ago I created a similar layout engine, it was extremely janky when I abandoned it because I first wanted to solve order/placing of the tiles but was unable to figure out a good algorithm for it Eg your example diagram has an optimal order in which there are no overlapping lines... But it's surprisingly hard to figure that out without doing n^m calculations... And I wanted to use it in a game, so a shitton…

https://github.com/kieler/elkjs works well for auto layout.

Re: Free SQL→ER diagram tool, runs in the browser, nothing uploaded

#44
Is there a way to hide connections to specific tables? Or alternatively filter out foreign keys by name.

For example in a multi-tenant application 90% of tables will link to the tenant table, but those links add little value to the viewer, so hiding these would be nice.

Re: Free SQL→ER diagram tool, runs in the browser, nothing uploaded

#45
post #2

I kept finding myself needing to visualize database schemas, but most tools had the same problems: paywalls, mandatory signups, or sending your SQL to someone else's server. So I ended up building my own. You paste in your CREATE TABLE statements and it generates an interactive ER diagram right in the browser. You can drag tables around, auto arrange the layout, edit table/column names directly on the canvas (it rewr…

Small? Yes, but perfectly formed! (Only minor tweak one could suggest would be multiple table selection for dragging... but to quote Frasier: "Think about it, Niles. What's the one thing better than an exquisite meal? An exquisite meal, with one tiny flaw we can pick at all night." Niles, raising a glass: "Ah, of course, to impossible standards.")

There's an endless list of improvements on a project like this.

- Dragging a group should also drag the tables within the group.

- It would be nice to be able to drag relationship lines to reshape their curves around other tables.

But what is here now is so well crafted that it feels uncomfortable asking for features without acknowledging how impressive it already is.

Re: Free SQL→ER diagram tool, runs in the browser, nothing uploaded

#46
post #21
post #17

Earlier quoted context omitted.

Thanks and I will add this to my todos!

A few years ago I created a similar layout engine, it was extremely janky when I abandoned it because I first wanted to solve order/placing of the tiles but was unable to figure out a good algorithm for it Eg your example diagram has an optimal order in which there are no overlapping lines... But it's surprisingly hard to figure that out without doing n^m calculations... And I wanted to use it in a game, so a shitton…

Not sure what you're seeing, but I see quite a few overlapping lines. One of them easily solvable if you move `addresses` down. It starts with the `orders->users` overlapping `orders->addresses`.

Also, the `reviews` table overlaps the line from `order_items` to `products` and moving `order_items` down for example gets rid of that problem.

Not saying the project isn't cool, but this layout isn't optimal as per your constraints.

Re: Free SQL→ER diagram tool, runs in the browser, nothing uploaded

#47
post #38

Have only had a quick look at it, but it looks very nicely done! Out of interest, did you use AI to assist with development? If yes, what percentage of the code would you say is AI generated vs conventional?

Given that it has only two commits, where the first one is just "done", I would guess a substantial amount.

Re: Free SQL→ER diagram tool, runs in the browser, nothing uploaded

#48
Reminds me of: https://explain.dalibo.com/

For visualizing query plans. One of the most useful tools for optimizing sql queries I’ve ever used.

Just make sure to download the fully offline v2 version at the bottom if you want to use it with anything sensitive.

Re: Free SQL→ER diagram tool, runs in the browser, nothing uploaded

#49
post #21

Earlier quoted context omitted.

A few years ago I created a similar layout engine, it was extremely janky when I abandoned it because I first wanted to solve order/placing of the tiles but was unable to figure out a good algorithm for it Eg your example diagram has an optimal order in which there are no overlapping lines... But it's surprisingly hard to figure that out without doing n^m calculations... And I wanted to use it in a game, so a shitton…

Not sure what you're seeing, but I see quite a few overlapping lines. One of them easily solvable if you move `addresses` down. It starts with the `orders->users` overlapping `orders->addresses`. Also, the `reviews` table overlaps the line from `order_items` to `products` and moving `order_items` down for example gets rid of that problem. Not saying the project isn't cool, but this layout isn't optimal as per your co…

Ah, I was imprecise in my comment. I didn't mean that this implementation was doing the optimal ordering - I was just reminiscing about a similar project I worked on an why I abandoned it (I was unable to get the ordering done while keeping performance good enough with thousands of tiles
Post reply on HN