Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ on:
tags: ['[0-9]+.[0-9]+.[0-9]+']

env:
IMAGE: ghcr.io/pongee/database-schema-visualization
IMAGE: pongeepublic/database-schema-visualization

permissions:
contents: read
packages: write

jobs:
build:
Expand All @@ -35,9 +34,8 @@ jobs:

- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ vars.DOCKER_HUB_USERNAME_FOR_GITHUB_DATABASE_SCHEMA_VISUALIZATION }}
password: ${{ secrets.DOCKER_HUB_PASSWORD_FOR_GITHUB_DATABASE_SCHEMA_VISUALIZATION }}

- id: meta
uses: docker/metadata-action@v6
Expand Down Expand Up @@ -81,9 +79,8 @@ jobs:

- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ vars.DOCKER_HUB_USERNAME_FOR_GITHUB_DATABASE_SCHEMA_VISUALIZATION }}
password: ${{ secrets.DOCKER_HUB_PASSWORD_FOR_GITHUB_DATABASE_SCHEMA_VISUALIZATION }}

- id: meta
uses: docker/metadata-action@v6
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.1.0] - 2026-07-28
### Changed
- Markdown output is shifted down one heading level — a `## Tables` top heading, an `h3` heading per table and `h4` section headings (Columns, Primary Key, Indexes, …) instead of `# Schema` / `h2` / `h3` — so the dump embeds cleanly under a document title
- PlantUML tables now carry a `«table»` stereotype label
- PlantUML template colors are set through the `$table_border_color` / `$table_background_color` variables using the `?=` default-assignment operator, replacing the `TABLE_BORDER_COLOR` / `TABLE_BACKGROUND_COLOR` `!define`s
- Image rendering streams the diagram through PlantUML's `--pipe` mode (stdin to stdout) instead of writing a temporary source and image file, so no `tmp/` working directory is needed
- The Markdown exporter returns the rendered template unchanged, dropping the leading-whitespace strip, blank-line collapsing and trailing-newline normalization (matching the PlantUML exporter)

## [5.0.0] - 2026-07-27
### Added
- Markdown export (`mysql:markdown` command and `Export\Markdown`) listing tables, columns, keys, indexes and connections, driven by a customizable Twig template (`src/Template/Markdown/v1.twig`)
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,23 @@ Output:
![Example output](example/output/sakila/sakila.png?raw=true "Output")

### Docker
The image is published to the GitHub Container Registry, built for both `linux/amd64` and `linux/arm64`.
The image is published to Docker Hub, built for both `linux/amd64` and `linux/arm64`.

```bash
$ docker pull ghcr.io/pongee/database-schema-visualization:latest
$ docker pull pongeepublic/database-schema-visualization:latest
```

Mount your schema into the container and pass the same command and options as on the CLI:

```bash
$ docker run --rm -v "$PWD/schema.sql:/app/schema.sql" \
ghcr.io/pongee/database-schema-visualization mysql:image --type png schema.sql > diagram.png
pongeepublic/database-schema-visualization mysql:image --type png schema.sql > diagram.png
```

List the available commands:

```bash
$ docker run --rm ghcr.io/pongee/database-schema-visualization list
$ docker run --rm pongeepublic/database-schema-visualization list
```

### PHP
Expand All @@ -89,6 +89,7 @@ $ docker run --rm ghcr.io/pongee/database-schema-visualization list
use Pongee\DatabaseSchemaVisualization\DataObject\Sql\Database\Connection\ConnectionCollection;
use Pongee\DatabaseSchemaVisualization\Export\Plantuml;
use Pongee\DatabaseSchemaVisualization\Generator\ImageGenerator;
use Pongee\DatabaseSchemaVisualization\Generator\ImageType;
use Pongee\DatabaseSchemaVisualization\Parser\MysqlParser;

include __DIR__ . '/../../vendor/autoload.php';
Expand All @@ -99,17 +100,15 @@ $sqlSchema = '
) ENGINE=innodb DEFAULT CHARSET=utf8;
';

$sqlParser = new MysqlParser();
// $cqlParser = new \Pongee\DatabaseSchemaVisualization\Parser\CassandraParser();
$parser = new MysqlParser(); // or CassandraParser(), MariadbParser();
$plantumlExport = new Plantuml(file_get_contents(__DIR__ . '/../../src/Template/Plantuml/v1.twig'));
$forcedConnectionCollection = new ConnectionCollection();
$imageGenerator = new ImageGenerator(
'png',
__DIR__ . '/../../bin/plantuml-mit-1.2026.6.jar',
__DIR__ . '/../../tmp/'
ImageType::Png,
__DIR__ . '/../../bin/plantuml-mit-1.2026.6.jar'
);

$schema = $sqlParser->run($sqlSchema, $forcedConnectionCollection);
$schema = $parser->run($sqlSchema, $forcedConnectionCollection);

print $imageGenerator->generate($plantumlExport->export($schema));
```
Expand All @@ -129,11 +128,11 @@ $sqlSchema = '
) ENGINE=innodb DEFAULT CHARSET=utf8;
';

$mysqlParser = new MysqlParser();
$parser = new MysqlParser();
$jsonExport = new Json();
$forcedConnectionCollection = new ConnectionCollection();

$schema = $mysqlParser->run($sqlSchema, $forcedConnectionCollection);
$schema = $parser->run($sqlSchema, $forcedConnectionCollection);

print $jsonExport->export($schema);
```
Expand Down Expand Up @@ -187,11 +186,11 @@ $sqlSchema = '
) ENGINE=innodb DEFAULT CHARSET=utf8;
';

$mysqlParser = new MysqlParser();
$parser = new MysqlParser();
$markdownExport = new Markdown(file_get_contents('./src/Template/Markdown/v1.twig'));
$forcedConnectionCollection = new ConnectionCollection();

$schema = $mysqlParser->run($sqlSchema, $forcedConnectionCollection);
$schema = $parser->run($sqlSchema, $forcedConnectionCollection);

print $markdownExport->export($schema);
```
Expand Down
Loading