k1LoW / tbls

tbls is a CI-Friendly tool for document a database, written in Go.
MIT License
3.37k stars 165 forks source link

Add `format.tableGroups` option for table grouping #436

Closed yasu89 closed 1 year ago

yasu89 commented 1 year ago

I am sorry to put out a series of PRs and I hope you will take a look at them when you have time 🙇‍♂️

About

For huge databases, the list of tables in the generated README.md is difficult to understand, so I implemented an option to group tables by user-specified groups.

resolve #311

Description

In the process of generating README.md with makeSchemaTemplateData() in output/md/md.go, tables are grouped in groups specified by the user and passed to the template.

Also, in the template, when a group of tables is provided, the template is implemented to display a list of tables by group.

In addition, I tried to output ER diagrams between tables within each group. (In schema.go, we implemented a method called NewSchemaForTableGroup() that generates a new Schema when a list of tables is passed to it, which is then passed to the process that generates the ER diagram.)

Consultation matter

k1LoW commented 1 year ago

@yasu89 Thank you for the great feature.

Currently, I am trying to implement a feature in tbls that is similar to this pull request.

It is to introduce the viewpoint/view concept (ref: https://www.viewpoints-and-perspectives.info/ / https://www.sbcr.jp/product/4797376722/ ).

I have already implemented this in another tool called ndiag ( ref ).

I now consider the following.

  1. README.md is not changed. If necessary, have it adjusted using templates: .
  2. Create another page according to the viewpoints: settings. The page should display each viewpoint's grouped table list, ER diagram, and description.
  3. Create links to each viewpoint pages in the README.md if and only if viewpoints: is set.

The reason I want to introduce the concept of viewpoints/views is that the grouped tables should have a very important meaning and I want to highlight it.


So, your pull request is very nice, but I can't merge it as is. Sorry.

yasu89 commented 1 year ago

@k1LoW Thank you for explaining the future implementation.

I agree that grouped tables are certainly important and should be highlighted. I look forward to waiting for the new features!

Thank you also for considering my PR!