{"id":28170,"library":"schema-viz","title":"Schema Viz","description":"Universal database schema visualizer that takes a schema file or directory and generates an interactive ER diagram in the browser with pan, zoom, and live reload. Currently at version 0.3.3, released monthly-ish. Supports Prisma, Laravel migrations, TypeORM, Drizzle ORM, JSON, and live PostgreSQL/MySQL introspection. Key differentiator: auto-layout based on FK-graph BFS, Figma-style select/edit modes, drag-and-drop persistence via share files, and framework detection with logos in the toolbar. Works as a CLI tool (global install) and runs a local server. No SaaS required.","status":"active","version":"0.3.3","language":"javascript","source_language":"en","source_url":"https://github.com/rexers-org/schema-viz","tags":["javascript"],"install":[{"cmd":"npm install schema-viz","lang":"bash","label":"npm"},{"cmd":"yarn add schema-viz","lang":"bash","label":"yarn"},{"cmd":"pnpm add schema-viz","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v0.3.0; CLI usage is via npx or global install, not programmatic imports.","wrong":"const schemaViz = require('schema-viz')","symbol":"default","correct":"import schemaViz from 'schema-viz'"},{"note":"Programmatic API is experimental; run() starts the server. Use CLI for normal usage.","wrong":"const run = require('schema-viz').run","symbol":"run","correct":"import { run } from 'schema-viz'"},{"note":"TypeScript types are exported for use in plugins or custom parsers.","wrong":"","symbol":"type definitions","correct":"import type { Schema, Table } from 'schema-viz'"}],"quickstart":{"code":"npx schema-viz ./prisma/schema.prisma --port=8080 --autoopen","lang":"typescript","description":"Launches an interactive ER diagram for a Prisma schema file, auto-opens browser."},"warnings":[{"fix":"Upgrade schema-viz to version 0.3.2 or later.","message":"Layout resets on every schema change before v0.3.2. Update to >=0.3.2 to preserve table positions across edits.","severity":"gotcha","affected_versions":"<0.3.2"},{"fix":"Specify --parser=prisma|laravel|typeorm|drizzle|json explicitly.","message":"Parser auto-detection may pick the wrong parser if multiple schema formats are present in the same directory. Use --parser flag to force a specific parser.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Use --autoopen instead of --auto-open.","message":"The --auto-open flag is deprecated in favor of --autoopen (without hyphen). Both work currently, but --auto-open may be removed in a future release.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Test connection with psql or mysql client before using --url.","message":"URL-based introspection requires a live database; if the URL is unreachable, the tool hangs silently until timeout. Use a valid connection string with proper credentials.","severity":"gotcha","affected_versions":">=0.2.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'npm install -g schema-viz' or use 'npx schema-viz' with an explicit version (e.g., npx schema-viz@0.3.3).","cause":"Global install failed or not in PATH; using npx without installing usually works but may pull an older version.","error":"Error: Cannot find module 'schema-viz'"},{"fix":"Specify --parser flag with the correct parser ID (e.g., --parser=laravel for Laravel migrations). Ensure files have expected extensions (.prisma, .json, .entity.ts, etc.).","cause":"The tool couldn't auto-detect a supported schema format in the given directory.","error":"Error: No parser detected for path './migrations'"},{"fix":"Use --port flag to choose a different port (e.g., --port=8080).","cause":"Another instance of schema-viz or other process is using the default port.","error":"Port 7337 is already in use"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}