alt.hn

6/14/2026 at 3:43:30 AM

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

https://sqltoerdiagram.com/

by robhati

6/14/2026 at 5:54:28 AM

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

by written-beyond

6/14/2026 at 8:53:54 AM

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.

by CraigJPerry

6/14/2026 at 7:33:02 AM

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

Yeah, my first thought was that the diagramming bit needs to be ripped out into its own library, because I can see a use for the diagramming bits for more than ER diagrams.

by lelanthran

6/14/2026 at 6:30:43 AM

That's really good yes, even double tapping editing does not reset the zoom level. Definitely one of the best mobile friendly site I have seen.

by Galanwe

6/14/2026 at 6:56:08 AM

This. Author(s) did the homework.

by sixtyj

6/14/2026 at 5:50:12 AM

Could we have the option of straight lines and 90 degree angles? I’ve never really liked the bendy ones. Looks cool, good job!

by corkybeta

6/14/2026 at 7:41:57 AM

Thanks and I will add this to my todos!

by robhati

6/14/2026 at 9:02:33 AM

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 of tiles.

Dunno where I was going with this, just got reminded of that project after looking at this great implementation.

It also reminded me of the xyflow lib

by ffsm8

6/14/2026 at 9:27:18 AM

In academia, this is called "planar embedding" and can be computed in O(V) where V is the number of vertices of the graph.

However, there are graphs that do not allow planar embeddings (e.g. K_5 or K_3,3, see https://en.wikipedia.org/wiki/Planar_graph).

In this case, you'll probably want to look into heuristics that produce a low number of crossings and little distortion when new vertices are added.

by johndough

6/14/2026 at 5:18:22 AM

It's a small too nothing great I just figured others might find it useful too. 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.

No backend, no accounts, no data leaving your machine.

A few implementation details that were fun:

* Built on <canvas> instead of DOM/SVG. Tables are rasterized into cached bitmaps with viewport culling, which keeps things smooth even with hundreds of tables on screen.

* The SQL parser tracks source spans for every token. That lets edits stay surgical so a rename a table and only the relevant identifier (and its references) change while comments and formatting remain untouched.

* The URL contains the entire schema. Sharing simply serializes the schema into the URL itself, so there's no backend, no stored state, and no account required.

* I also experimented with a Rust/WASM version because why not? but the parser was ~37% slower because the JS↔WASM boundary cost outweighed the compute savings but The O(n^2) overlap-resolution pass was about 2.2x faster though * In the end I stuck with plain JavaScript. No framework ~32KB gzipped

by robhati

6/14/2026 at 9:15:54 AM

> The URL contains the entire schema.

Isn’t that going to be a problem due to the URL length limitations?

> It is RECOMMENDED that all senders and recipients support, at a minimum, URIs with lengths of 8000 octets in protocol elements.

https://www.rfc-editor.org/rfc/rfc9110#section-4.1-5

by Hendrikto

6/14/2026 at 8:31:09 AM

Truely good work! It’s responsive, clean and “onboarding” experience without signup walls is great. Good job.

by __natty__

6/14/2026 at 7:08:54 AM

Maybe you can support schemas in more dialects by using a similar approach to a little tool I made: sqlscope.netlify.app

Basically integrate sqlglot to translate the schema between dialects and then use a base dialect for generating the schema.

The two tools seem complementary and you seem to be a better designer, so it would be nice to see it all together

by WhyIsItAlwaysHN

6/14/2026 at 5:48:44 AM

I was looking for it, thanks! Great work!

by agentic_vector

6/14/2026 at 5:00:34 AM

The GitHub link takes you to the front page of GitHub instead of the actual project.

by _f1ou

6/14/2026 at 5:09:05 AM

   Just to clarify, what link is it?  
   I've check it out, and the GitHub icon, in the header on the top right corner, is correct, and links to the following project:  
   - https://github.com/royalbhati/sqltoerdiagram

by serious_angel

6/14/2026 at 5:12:45 AM

I have just updated it. He was right to point that out.

by robhati

6/14/2026 at 5:12:55 AM

updated thanks.

by robhati

6/14/2026 at 5:54:09 AM

Okay thats pretty cool. Nice job!

by John_Kwick

6/14/2026 at 3:45:47 AM

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 rewrites the SQL for you), add notes and group boxes, and export as PNG or SVG.

No backend, no accounts, no data leaving your machine.

A few implementation details that were fun:

* Built on <canvas> instead of DOM/SVG. Tables are rasterized into cached bitmaps with viewport culling, which keeps things smooth even with hundreds of tables on screen.

* The SQL parser tracks source spans for every token. That lets edits stay surgical so a rename a table and only the relevant identifier (and its references) change while comments and formatting remain untouched.

* The URL contains the entire schema. Sharing simply serializes the schema into the URL itself, so there's no backend, no stored state, and no account required.

* I also experimented with a Rust/WASM version because why not? but the parser was ~37% slower because the JS↔WASM boundary cost outweighed the compute savings but The O(n^2) overlap-resolution pass was about 2.2x faster though * In the end I stuck with plain JavaScript. No framework ~32KB gzipped

It's a small too nothing great I just figured others might find it useful too.

by robhati