4 ms·
Author here, I didn't bother submitting this to HN because I figured it would be too niche and trivial to get much attention. Evidently I was wrong!
by thristian 3y ago
Author here, I didn't bother submitting this to HN because I figured it would be too niche and trivial to get much attention. Evidently I was wrong!
- meitham 3y agoThe fact you achieved this with a query and graphiz is impressive! I wonder how much tweaks this query needs to make it work with DuckDB.
- alexvoda 3y agoReally love that you used Kunth's "Literate programming" to document the code. You don't see it often but I find it really nice when seeing it.
- deleted 3y ago[deleted]
- vsnf 3y agoIt also adds a severe amount of visual clutter between the code. Individual preference I’m sure, but I’d prefer less comments, I think. Or maybe my IDE just needs to collapse comments inside functions automatically.
- thristian 3y agoIf this were commonly-used code at the core of a project, I would definitely agree. However, this is the kind of thing that gets stuck into a CI pipeline and not looked at for months or years, and it's written in two languages (GraphViz and very SQLite-specific SQL) that probably most people don't use regularly. I gave it the comments I'll wish it had the next time I come back to it, to figure out how it works.
- keepamovin 3y agoThis is very cool. Reminds me of my days 13 years ago using dot to draw complex planaarized graph diagrams before switching to physics / springs models, graph embeddings, and other cool things. Nice to see a really good use for dot. I created a fork on GitHub as a fork there'll be easier for me to come back to, find, organize and use (and may be for others too): https://github.com/o0101/sqlite-schema-diagram https://github.com/o0101/sqlite-schema-diagram I hope you don't mind? If you don't want ur code there let me know and I'll sadly but obediently take it down and just link to it from someplace on there I can readily find. :)
- thristian 3y agoIt's such a small script, most of the repository is documentation, so I expected (hoped) it would get copied to a lot of places. It's fine. :)
- ncruces 3y agoI know this is terribly unfortunate, and supporting the monopoly, but consider a GitHub mirror. I just mirrored it myself to keep tabs on it, because otherwise I'll forget it. Very interesting approach.
- vanous 3y agoMy opinion will probably not be popular, but by making the mirror you are helping with creating this monopoly. I see the solution in creating small single/few page(s) landing site and linking to the code and releases, being it to self/hosted Gitea, Forgejo, Gitlab, GitHub...
- ncruces 3y agoIt's not unpopular: I know. I mean, I mentioned the monopoly in my comment for a reason. But for this niche purpose, GitHub is my (last) social media, and GitHub stars are my bookmarks. So, yeah, I agree, but your suggestion does little for me to not forget it when I'm looking for something SQLite related, and definitely doesn't help me follow project updates (like a proper GitHub mirror would). I'm sorry.
- thristian 3y agoSomebody upthread[1] also made a GitHub mirror. I appreciate that different people have different comfort-levels with the centralisation of services like GitHub, but luckily it's really easy for people to copy a Git repo to a host they're more comfortable with, like GitHub or SourceHut or even making a local clone. [1]: https://news.ycombinator.com/item?id=39800533 https://news.ycombinator.com/item?id=39800533
- ncruces 3y agoI think I did it first… or I just missed it. Well, as long as you're not brothered with it, great! I know I'm not adding much value, I just wanted to “bookmark it” for myself.
- NortySpock 3y agoVery nice, I've been doing some similar things at work to help map out a data warehouse migration project. Have you considered outputting to a MermaidJS format? https://mermaid.js.org/syntax/entityRelationshipDiagram.html https://mermaid.js.org/syntax/entityRelationshipDiagram.html
- thristian 3y agoI have not considered outputting to MermaidJS, but (from a quick glance at that documentation) it looks like the same "SQL template" technique should work. Actually doing it is left as an exercise for the reader. :)
- _ache_ 3y agoThank you. Interesting little tool.
- tejtm 3y agoLikewise, the niche pressure for me came from SQLite being agnostic to a canonical form for SQL `.schema`. I did not need to get into parsing every flavor. https://github.com/TomConlin/SQLiteViz https://github.com/TomConlin/SQLiteViz