Tbls についての Tips
Tbls についての Tipsを備忘録として残しておく
環境 OS: macOS 15.3 手順 Tbls について 実際の DB に接続してテーブル定義書を生成してくれるツール
様々な形式(markdown, Excel 等)で生成してくれる
※詳細は Tbls を参照
設定ファイルについて # # @see https://github.com/k1LoW/tbls # # Data Source Name ## @see https://github.com/k1LoW/tbls#dsn # dsn: postgres://<<user>>:<<pass>>@localhost:5432/<<dbname>> # To connect with SSL mode disabled # dsn: postgres://<<user>>:<<pass>>@localhost:5432/<<dbname>>?sslmode=disable # DSN configuration values should be found in the .env file TBLS_DSN # Disable output of schema data # Default is false disableOutputSchema: false format: # Adjust the column width of Markdown format table # Default is false adjust: true # Sort the order of table list and columns # Default is false sort: false # Display sequential numbers in table rows # Default is false number: false # The comments for each table in the Tables section of the index page will display the text up to the first double newline (first paragraph). # Default is false showOnlyFirstParagraph: true # Hide table columns without values # Default is false hideColumnsWithoutValues: false # It can be boolean or array # hideColumnsWithoutValues: ["Parents", "Children"] er: # Skip generation of ER diagram # Default is false skip: false # ER diagram image format (`png`, `jpg`, `svg`, `mermaid`) # Default is `svg` format: mermaid # Add table/column comment to ER diagram # Default is false comment: false # Hide relation definition from ER diagram # Default is false hideDef: true # Show column settings in ER diagram. If this section is not set, all columns will be displayed (default). showColumnTypes: # Show related columns related: true # Show primary key columns primary: true # Distance between tables that display relations in the ER # Default is 1 distance: 1 # ER diagram (png/jpg) font (font name, font file, font path or keyword) # Default is "" ( system default ) font: "" detectVirtualRelations: enabled: true strategy: default # Exclude tables exclude: - goose_db_version docPath: docs/ja/ comments: - table: mst_books tableComment: |- 書籍情報を管理するテーブル columnComments: name: 書籍名 TBLS_DSN=postgres://postgres:postgres@localhost:5432/olbdb?sslmode=disable 出力ファイルの上書きについて # markdown tbls doc --config .tbls.yml --rm-dist # Excel tbls out --config .tbls.yml -t xlsx -o schema.xlsx DSN の設定について ローカルで実施する場合は以下のどちらかで可能