https://github.com/pongee/database-schema-visualization
https://github.com/pongee/database-schema-visualization
database mariadb mysql plantuml visualization
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pongee/database-schema-visualization
- Owner: pongee
- License: other
- Created: 2022-01-05T20:13:50.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-05T18:04:28.000Z (over 1 year ago)
- Last Synced: 2025-09-14T06:38:43.917Z (9 months ago)
- Topics: database, mariadb, mysql, plantuml, visualization
- Language: PHP
- Homepage:
- Size: 7.13 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Database schema visualization
[](https://packagist.org/packages/pongee/database-schema-visualization)
[](https://php.net/)
[](https://github.com/pongee/database-schema-visualization/blob/main/LICENSE)

## Project goal
The aim of this project is to generate database documentation from sql schema.
## Supported databases
- MySQL
- MariaDB
- Apache Cassandra (Basics)
## Supported Output formats
- PNG, SVG image
- Plantuml raw text
- Json
## Pre Installation
- https://graphviz.gitlab.io/download/
## Installation
```bash
$ composer require pongee/database-schema-visualization
or add it the your composer.json and make a composer update pongee/database-schema-visualization.
```
## Usage
### In console
#### PNG export
```bash
$ php ./database-schema-visualization mysql:image ./example/schema/sakila.sql > ./example/img/sakila.png
$ php ./database-schema-visualization mysql:image --type png ./example/schema/sakila.sql > ./example/img/sakila.png
```
Output:

#### SVG export
```bash
$ php ./database-schema-visualization mysql:image --type svg ./example/schema/sakila.sql > ./example/img/sakila.svg
```
#### Json export
```bash
$ php ./database-schema-visualization mysql:json ./example/schema/sakila.sql
```
#### Plantuml export
```bash
$ php ./database-schema-visualization mysql:plantuml ./example/schema/sakila.sql
```
### PHP
#### Png export
```php
run($sqlSchema, $forcedConnectionCollection);
print $imageGenerator->generate($plantumlExport->export($schema));
```
#### Json export
```php
run($sqlSchema, $forcedConnectionCollection);
print $jsonExport->export($schema);
```
This will generate:
{
"tables": {
"foo": {
"columns": [
{
"name": "id",
"type": "INT",
"typeParameters": [
"10"
],
"otherParameters": "UNSIGNED NOT NULL",
"comment": "The id"
}
],
"indexs": {
"simple": [],
"spatial": [],
"fulltext": [],
"unique": []
},
"primaryKey": []
}
},
"connections": []
}