News for hackers. Stuff that matters.
Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by maweki on Sunday April 07, 2019 @04:03AM (#19595475)
The diagrams in that way are problematic. When you model them as digraphs and use this layout and order them from too to bottom you get all the tables at the top that represent n:m relationships and at the bottom (at different levels) your main/independent entities.

At least bottom to top would pack the independent ones to the top and those that represent many-to-many relationships at the bottom.

From my work with Oracle Datamodeler know that even at a dozen tables manual layout beats an algorithm any time. And the oracle algithms are more sophisticated/less general than dot.

Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by akarki15 on Sunday April 07, 2019 @12:00PM (#19597607)
That's a valid concern. My inspiration for writing this tool was to create schema diagrams for select tables (hence the -whitelist flag in the tool) rather than _all_ the tables. Think design review, presentation etc instead of exploring a new db. Having some way to dictate what table would be at the top vs. bottom would be nice.

My only fear with that is dbdot becomes bloated with flags and features. If customization of dot can be achieved by piping dbdot output to some other tool, I will explore that path.

Thank you for your feedback :)

Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by stubish on Sunday April 07, 2019 @05:42AM (#19595810)
Anyone know of any tools that let you manually layout the elements in a dotfile such as generated by dbdot or similar tools?
Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by mistrial9 on Sunday April 07, 2019 @10:21AM (#19596912)
.. not a giant fan of AI but, this sounds like exactly the sort of thing an AI could be taught to do ..
Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by wongarsu on Sunday April 07, 2019 @12:18PM (#19597763)
The best tool I've found for generating Postgres schema diagrams is Datagrip's diagram feature [2]. It's not without flaws and doesn't seem to get much love, but it also does a lot of things right: tables are arranged in a tree like fashion, where the most referenced tables end up on top. Right angled connectors look orderly even when 10 different tables reference one table (if we ignore the labels on the connectors). The color scheme is also quite nice if you leave datagrip in dark mode.

1: https://www.jetbrains.com/datagrip/features/

2: https://community.intersystems.com/sites/default/files/inlin...

Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by nathancahill on Sunday April 07, 2019 @09:05AM (#19596570)
For high-level/quick-and-dirty designing I'm a fan of https://dbdiagram.io/
Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by akarki15 on Sunday April 07, 2019 @12:23PM (#19597817)
That's a cool website. I would say my usecase is really focused on picking existing n tables in a db for like a design or presentation. I would not want to handcraft tables as I don't care what the diagram looks like; all I care is that the diagram accurately reflects the schema.

I intend to stick true to my inspiration and keep dbdot focused for that usecase. Hence, I expect this tool to actually reach a completion after which I don't think I will want to add any more features.

Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by maweki on Sunday April 07, 2019 @09:48AM (#19596734)
That's not high level design though. High level would be (for example) in Barker-notation were you have subclasses and n:m relationships are not represented as their own entities.

Only as a next step you translate that to the actual relations.

Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by mmsimanga on Sunday April 07, 2019 @11:08AM (#19597220)
I have had great success with Schema Spy[0]. It documents your database and includes a schema diagram.

[0]https://github.com/schemaspy/schemaspy

Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by djrobstep on Sunday April 07, 2019 @01:48AM (#19595029)
Good schema design tools are the missing piece for making PostgreSQL the complete package.

Ideally there'd be an officially supported tool that allowed you to define your relationships at a high level and it would create a well normalised and indexed schema for you automatically.

Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by kuroguro on Sunday April 07, 2019 @04:51AM (#19595644)
There's pgmodeler: https://pgmodeler.io/
Re:Show HN: Dbdot – Golang tool to help generate Postgres sc... by MichaelBosworth on Saturday April 06, 2019 @11:58PM (#19594745)
Neat! Thank you.