{"id":35370155,"url":"https://github.com/samdouble/migration-visualizer","last_synced_at":"2026-01-13T19:22:45.780Z","repository":{"id":331131292,"uuid":"1123811069","full_name":"samdouble/migration-visualizer","owner":"samdouble","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-09T23:08:18.000Z","size":396,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-10T20:10:19.247Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samdouble.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-27T17:12:37.000Z","updated_at":"2026-01-09T23:07:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/samdouble/migration-visualizer","commit_stats":null,"previous_names":["samdouble/migration-visualizer"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/samdouble/migration-visualizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdouble%2Fmigration-visualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdouble%2Fmigration-visualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdouble%2Fmigration-visualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdouble%2Fmigration-visualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samdouble","download_url":"https://codeload.github.com/samdouble/migration-visualizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdouble%2Fmigration-visualizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28397826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-02T02:52:35.403Z","updated_at":"2026-01-13T19:22:45.774Z","avatar_url":"https://github.com/samdouble.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/samdouble/migration-visualizer/actions/workflows/checks.yml/badge.svg)](https://github.com/samdouble/migration-visualizer/actions/workflows/checks.yml)\n[![npm version](https://img.shields.io/npm/v/migration-visualizer.svg?style=flat)](https://www.npmjs.org/package/migration-visualizer)\n[![Downloads](https://img.shields.io/npm/dm/migration-visualizer.svg?style=flat)](https://www.npmjs.org/package/migration-visualizer)\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/migration-visualizer)\n[![Coverage Status](https://coveralls.io/repos/samdouble/migration-visualizer/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/samdouble/migration-visualizer?branch=master)\n\n[![Node.js](https://img.shields.io/badge/Node.js-6DA55F?logo=node.js\u0026logoColor=white)](https://nodejs.org/)\n[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript\u0026logoColor=fff)](https://www.typescriptlang.org/)\n[![MySQL](https://img.shields.io/badge/MySQL-4479A1?logo=mysql\u0026logoColor=fff)](https://www.mysql.com/)\n[![Postgres](https://img.shields.io/badge/Postgres-%23316192.svg?logo=postgresql\u0026logoColor=white)](https://www.postgresql.org/)\n[![SQLite](https://img.shields.io/badge/SQLite-%2307405e.svg?logo=sqlite\u0026logoColor=white)](https://www.sqlite.org/)\n[![Jest](https://img.shields.io/badge/Jest-C21325?logo=jest\u0026logoColor=fff)](https://jestjs.io/)\n[![npm](https://img.shields.io/badge/npm-CB3837?logo=npm\u0026logoColor=fff)](https://www.npmjs.com/)\n\n# Migration Visualizer\n\nThis tool outputs Entity Relationship diagrams for Knex.js and Kysely migrations in Mermaid format.\n\n## Usage\n\nInstall the package:\n\n```bash\nnpm install -g migration-visualizer\n```\n\nAnd then use it through the CLI.\n\n### CLI\n\n```bash\nnpx migration-visualizer visualize [options]\n```\n\n#### Options\n\n| Option | Description | Required |\n|--------|-------------|----------|\n| `--query-builder \u003cquery-builder\u003e` | Query builder to use (`knex`, `kysely`) | Yes |\n| `--changed \u003cfiles...\u003e` | List of new and updated migration files | No |\n| `--output \u003cformat\u003e` | Output format (default: `mermaid`) | No |\n\n#### Kysely-specific Options\n\n| Option | Description | Required |\n|--------|-------------|----------|\n| `--dialect \u003cdialect\u003e` | Database dialect (`sqlite3`, `mysql2`, `pg`) | Yes |\n| `--migrations \u003cpath\u003e` | Path to migrations directory | Yes |\n| `--host \u003chost\u003e` | Database host | No |\n| `--port \u003cport\u003e` | Database port | No |\n| `--database \u003cdatabase\u003e` | Database name | No |\n| `--user \u003cuser\u003e` | Database user | No |\n| `--password \u003cpassword\u003e` | Database password | No |\n| `--filename \u003cfilename\u003e` | Database filename (SQLite) | No |\n| `--useNullAsDefault` | Use null as default (SQLite) | No |\n\n#### Examples\n\n##### Knex.js\n\n`migration-visualizer` detects the Knexfile at the root of your project and uses it for configuration.\n\n```bash\nnpx migration-visualizer visualize --query-builder knex --changed 20251227000006_create_likes.ts\n```\n\n##### Kysely\n\nSince Kysely does not provide a configuration file, you need to provide the dialect, migrations directory, and other connection details.\n\n**With MySQL**:\n\n```bash\nnpx migration-visualizer visualize \\\n  --query-builder kysely \\\n  --dialect mysql2 \\\n  --host localhost \\\n  --port 3306 \\\n  --database mydb \\\n  --user root \\\n  --password secret \\\n  --migrations ./migrations \\\n  --changed 20251227000006_create_likes.ts\n```\n\n**With PostgreSQL**:\n\n```bash\nnpx migration-visualizer visualize \\\n  --query-builder kysely \\\n  --dialect pg \\\n  --host localhost \\\n  --port 5432 \\\n  --database mydb \\\n  --user postgres \\\n  --password secret \\\n  --migrations ./migrations \\\n  --changed 20251227000006_create_likes.ts\n```\n**With SQLite**:\n\n```bash\nnpx migration-visualizer visualize \\\n  --query-builder kysely \\\n  --dialect sqlite3 \\\n  --filename dev.sqlite3 \\\n  --migrations ./migrations \\\n  --changed 20251227000006_create_likes.ts\n```\n\n### GitHub Action\n\nTODO\n\n## Features\n\n### Supported Query Builders\n\n- Knex.js\n- Kysely\n\n### Supported Databases\n\n- MySQL\n- PostgreSQL\n- SQLite\n\n### Supported Output Formats\n\n- Mermaid\n\n## Development\n\n### Testing\n\nSimply run the following command to run the tests:\n\n```bash\nnpm run test\n```\n\nFor now, the PostgreSQL tests are only run in the CI. It would be nice to be able to run them locally as well, but I couldn't find a way to set up simply a PostgreSQL server (`pg-mem` currently does not support migrations and a few other important features needed in this project).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamdouble%2Fmigration-visualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamdouble%2Fmigration-visualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamdouble%2Fmigration-visualizer/lists"}