Search by

janalis / doctrineviz

phcorp

Generate Graphviz DOT diagrams from a Doctrine DBAL database schema.

Package info

github.com/janalis/doctrineviz

Type:symfony-bundle

pkg:composer/janalis/doctrineviz

Statistics

Installs: 326

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 2

v0.5.0 2026-10-31 11:47 UTC

This package is auto-updated.

Last update: 2026-10-31 11:48:58 UTC


README

doctrineviz

doctrineviz

Your database schema, drawn.
Doctrine DBAL · Graphviz, Mermaid and PlantUML · SVG, PNG and PDF · Symfony bundle

CI Docs Latest release Packagist BSD-3-Clause license

Documentation · Installation · Command reference · Migration

doctrineviz reads your database schema through Doctrine DBAL and generates a Graphviz, Mermaid or PlantUML diagram with tables, columns, primary keys and foreign keys, or renders it straight to SVG, PNG or PDF with viz, natively in PHP. Run it in a Symfony application, or use the exporter 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.5+, Symfony 7.4 or 8.x, DoctrineBundle 3.3+, and DBAL 4.5+. See Installation.

Quick start

php bin/console doctrine:schema:graphviz --output=schema.svg      # drawn natively, no Graphviz needed
php bin/console doctrine:schema:graphviz --output=schema.pdf
php bin/console doctrine:schema:graphviz --format=mermaid > schema.mmd
php bin/console doctrine:schema:graphviz --format=plantuml > schema.puml
php bin/console doctrine:schema:graphviz > schema.dot

Example database diagram

Highlights

  • Database schema diagrams show the actual schema, including tables not mapped by ORM.
  • Three languages: Graphviz DOT, a Mermaid erDiagram and a PlantUML entity diagram, with cardinalities.
  • Images without tools: --output=schema.svg|png|pdf renders natively; --engine=cli uses dot, mmdc or plantuml instead.
  • 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-translations and --infer-gedmo-logs.
  • Reusable exporter accepts a DBAL Schema without 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

License

BSD-3-Clause.