janalis / doctrineviz
Generate Graphviz DOT diagrams from a Doctrine DBAL database schema.
Requires
- php: ^8.4
- doctrine/dbal: ^4.5
- doctrine/doctrine-bundle: ^3.3
- doctrine/persistence: ^4.0
- symfony/console: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.4 || ^8.0
- symfony/http-kernel: ^7.4 || ^8.0
Requires (Dev)
- carthage-software/mago: ^1.57
- infection/infection: ^0.35.8
- phpunit/phpunit: ^12.5
- symfony/framework-bundle: ^7.4 || ^8.0
- symfony/process: ^7.4 || ^8.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
doctrineviz
Your database schema, drawn.
Doctrine DBAL · Graphviz DOT · Symfony bundle
Documentation · Installation · Command reference · Migration
doctrineviz reads your database schema through Doctrine DBAL and generates a Graphviz DOT diagram with tables, columns, primary keys and foreign keys. Run it in a Symfony application, or use the renderer directly with a DBAL schema. Doctrine ORM is optional.
Install
composer require --dev janalis/doctrineviz
Register Janalis\Doctrineviz\DoctrinevizBundle::class for the dev and
test environments in config/bundles.php. Requires PHP 8.4+, Symfony
7.4 or 8.x, DoctrineBundle 3.3+, and DBAL 4.5+.
See Installation.
Quick start
php bin/console doctrine:schema:graphviz > schema.dot # Install Graphviz separately to render the DOT file. dot -Tsvg schema.dot -o schema.svg dot -Tpdf schema.dot -o schema.pdf
Highlights
- Database schema diagrams show the actual schema, including tables not mapped by ORM.
- Column details include DBAL type, length, nullability, defaults and auto-increment.
- Relationships preserve composite foreign-key column pairs and self-references.
- Named connections through
--connection=reporting. - Optional Gedmo links through
--infer-gedmo-translationsand--infer-gedmo-logs. - Reusable renderer accepts a DBAL
Schemawithout booting Symfony.
Contributing
Read CONTRIBUTING.md and the development guide. Use synthetic schemas in reports and tests; redact connection details and private data.
make install make verify # formatting, lint, analysis, workflows, tests, 100% coverage and MSI make docs # build the VitePress documentation make help # list all developer commands