k1LoW / tbls

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

Configuration File Customization - Support for custom file names #548

Closed koyama-yoshihito closed 9 months ago

koyama-yoshihito commented 9 months ago

Hello, I am currently using tbls for my project and it has been very useful. However, I have a feature request to enhance its functionality.

In current implementation, tbls loads configuration from a default .tbls.yml file. My project could benefit from the ability to specify custom configuration files (for example, .tbls-beta.yml), allowing us to manage different settings for different environments or stages within the same repository.

Here's a sample use case:

  1. I have different database configurations for database1 and database 2.
  2. Each database configuration is written in a separate configuration file like .tbls-1.yml and .tbls-2.yml.
  3. I want to specify the configuration file when running tbls, like tbls doc -c .tbls-1.yml.

I understand that a workaround may be to copy or link the desired configuration file to .tbls.yml before running tbls. However, it would be more straightforward and less error-prone if tbls could support the specification of a configuration file directly.

Thank you for considering this feature request. I believe this feature would add flexibility and aid in managing multiple environments.

k1LoW commented 9 months ago

Hi, @koyama-yoshihito

I want to specify the configuration file when running tbls, like tbls doc -c .tbls-1.yml.

There is exactly the -c (--config) flag.

~ > tbls doc --help
'tbls doc' analyzes a database and generate document in GitHub Friendly Markdown format.

Usage:
  tbls doc [DSN] [DOC_PATH] [flags]

Flags:
  -j, --adjust-table       adjust column width of table
  -b, --base-url string    base url for links
  -c, --config string      config file path
      --dsn string         data source name
  -t, --er-format string   ER diagrams output format (png, jpg, svg, mermaid). default: svg
      --exclude strings    tables to exclude
  -f, --force              force
  -h, --help               help for doc
      --include strings    tables to include
      --label strings      table labels to be included
      --rm-dist            remove files in docPath before generating documents
      --sort               sort
      --table strings      target table (tables to include)
      --when string        command execute condition
      --without-er         no generate ER diagrams
~ >

I have a feeling that perhaps I am not understanding your request.

If this is not the answer you were looking for, please give me some more information.

k1LoW commented 9 months ago

( And thank you for sponsoring us. It is very encouraging. 🚀 )

koyama-yoshihito commented 9 months ago

I overlooked that option! Thank you very much!

( And thank you for sponsoring us. It is very encouraging. 🚀 )

Merry Christmas !! 🎅 Get a nice LEGO toy (∩´。•ω•)⊃🎁

koyama-yoshihito commented 9 months ago

I'm closing this issue.