achiku/planter

Would like to see more info about columns

paunin opened this issue · 4 comments

Would like to see more info about columns

  • Type
  • If field[s] is indexed
  • Comment

My personal rules:

  • column definition: {name} {SQL type} [-- {comment}]
  • Primary keys should be in the header of each table
  • Foreign keys should be marked with + (will be displayed as green dot) with reference in comment
  • Indexed fields should be marked as bold
  • Comments starts with --
  • Comments for table should be put in header of each table
  • Relationships should be placed

and see no need to mark PK with [PK] btw

That's may be nice to have feature. Since this tool is using Go template to write PlantUML, it'll be easy to make it customizable. Could you send pr?

I have posted a related PR for reformatting the format. Take a look at template.go to adjust the formatting, and sql.go for the SQL that fetches table and column details if you need more.

Locally I have a change that uses DOMAINs to rename BIGINTs so that I can implicitly add (non-declared, but logically present) FK from arrays to detail tables. The code is specific to our site but as long as the data is made available the templates lay things out appropriately.

Related issue: I wanted to label relationship lines with the "from" column names and added them to the templates, but layout is really bad (the labels get laid out in a grid unrelated to the relationship lines they are associated with)
One ||-o{ Two : Field1, field2
lays out One and Two with the appropriate line between them, but the field1, field2 text appears on the diagram unrelated to the relationship. Should we use a different syntax in the UML?