{"id":28149491,"url":"https://github.com/fahmifan/tblsrun","last_synced_at":"2026-03-01T02:31:26.722Z","repository":{"id":65950200,"uuid":"599360520","full_name":"fahmifan/tblsrun","owner":"fahmifan","description":"Generate database documentation from migration files","archived":false,"fork":false,"pushed_at":"2023-03-15T02:59:03.000Z","size":178,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T10:09:45.550Z","etag":null,"topics":["container","database","database-documentation","docker","documentation","postgres","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fahmifan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-09T01:08:25.000Z","updated_at":"2023-08-09T17:07:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc482dbc-c976-4e63-b6ff-379c3313a376","html_url":"https://github.com/fahmifan/tblsrun","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fahmifan/tblsrun","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahmifan%2Ftblsrun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahmifan%2Ftblsrun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahmifan%2Ftblsrun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahmifan%2Ftblsrun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fahmifan","download_url":"https://codeload.github.com/fahmifan/tblsrun/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahmifan%2Ftblsrun/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29959038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container","database","database-documentation","docker","documentation","postgres","postgresql"],"created_at":"2025-05-15T02:13:54.278Z","updated_at":"2026-03-01T02:31:26.702Z","avatar_url":"https://github.com/fahmifan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tblsrun\n\nGenerate database documentation from migration files. Uses [tbls](github.com/k1LoW/tbls) internally to generate the docs.\nUseful for reviewing database schema change in your team.\n\n## How it works?\nIt works by spawning a database, then it will run the migrations files, and run the `tbls` to generate the db doc.\n\nCurrently it only support `postgres` for the DB \u0026 [golang-migrate](https://github.com/golang-migrate/migrate) for migration files format\n\n## Example Database\n\nHere is the example database documentation [link](/example/dbdoc/foo/README.md)\n\n### Snippets\n\n![db documentation snipped](doc/dbdoc-snippet.png)\n\n## Installation\n```\ngo install github.com/fahmifan/tblsrun/cmd/tblsrun@latest\n```\n\n## How To Use\n- Set env variables, you can use `.env.example` as a reference.\n- Create tbls config (see `example.tbls.yml`)\n- Then run `tbslrun`, e.g.: `tblsrun postgres docker`\n  - Currently it only support `postgres` with 2 modes `embedded` or `docker`\n    - `embedded` will run postgres binary as child process\n    - `docker` will spawn a postgres docker container, you need docker installed to use this\n  - When running, it will install the latest `tbls` automatically if not exists in the `$PATH`\n\n### Environtment Variables\n- `TBLS_DATABASE_NAME`\n  - your database name, it will be use in the generated doc\n- `TBLS_DATABASE_SCHEMA`\n  - your database schema, it will be use in the generated doc\n- `TBLS_DATABASE_PORT`\n  - override the default database port (e.g. postgres: 5432)\n- `TBLS_MIGRATION_DIR`\n  - the directory where your migration files are located \n  - currently only support `golang-migrate` format\n- `TBLS_CONFIG_FILE`\n  - the path to your `tbls` config file\n\n### Multiple migrations folder \u0026 schemas\nOne use case for this is when you have multiple schemas in your database with separate migrations folder, and you want to generate the doc for each schema. \n\nTo enable this, you need to set the `TBLS_DATABASE_SCHEMA` to `schema_1,schema_2,schema_n`, and the `TBLS_MIGRATION_DIR` to `dir_1,dir_2,dir_n`. \n \nIf we want to generate it into different folder, we need to have multiple `.tbls.yml` \u0026 `.env` files, example to configure this:\n```yml\n# schema_1.tbls.yml\ndocPath: example/dbdoc/bar\n\n# schema_2.tbls.yml\ndocPath: example/dbdoc/foo\n```\n\nCheck [example](/example/README.md) for more details.\n\n### Available Commands\n```\nGenerate database documentation from migration files\n\nUsage:\n  tblsrun [command]\n\nAvailable Commands:\n  help        Help about any command\n  postgres    Run tbls with postgres\n\nFlags:\n      --env-file string   --env-file=\"custom.env\" (default \".env\")\n  -h, --help   help for tblsrun\n```\n\n## Testing\nTo do manual test we can run `make dbdoc` and check there should be 2 output","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahmifan%2Ftblsrun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffahmifan%2Ftblsrun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahmifan%2Ftblsrun/lists"}