Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an independent parameter to control whether columns are sortable. #619

Open
shellwalker opened this issue Sep 12, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@shellwalker
Copy link

If parameter format.sort is set to true , tables, columns, relations, constraints, and viewpoints will all be sorted by Name after Schema.Sort is called.

After execute the command tbls doc, it will generate an index file which named README.md in output directory doc/schema, the order of table, relations... keep the consistency, it looks good for me.

But for the columns' order in each table file(e.g., table-A.md), I still want to keep the default creation order instead of sorting them by name.

func (s *Schema) Sort() error {
...

  // if ( newSortFlag ) {
  sort.SliceStable(t.Columns, func(i, j int) bool {
			  return t.Columns[i].Name < t.Columns[j].Name
		  })
  // }
...
}

Thanks.

@shellwalker shellwalker added the enhancement New feature or request label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant