hywan/database-to-plantuml

将数据库表信息提取为 PlantUML 描述。

1.1.0 2017-09-06 12:36 UTC

This package is not auto-updated.

Last update: 2024-09-15 03:39:34 UTC


README

此实用工具可以将数据库的图形 2D 可视化。

目前,唯一支持的客户端是 PostgreSQLMySQL。有 2 个后端:commonmarkplantumlplantuml 后端允许生成以下格式的可视化

  • PNG
  • SVG
  • EPS
  • PDF
  • VDX
  • XMI
  • HTML
  • TXT
  • UTXT
  • LaTeX

安装

使用 Composer,只需运行以下命令

$ composer install

如果您想将其用作项目依赖项,那么

$ composer require hywan/database-to-plantuml

要使用 plantuml 后端,您可以使用位于 resource/plantuml.jar 的 JAR 文件。

使用…的示例

… PostgreSQL

以著名的 employees 用例为例

# Import the schema.
$ psql -f resource/samples/pgsql-employees.sql postgres

# Generate the visualisation.
$ bin/database-to-plantuml -d 'pgsql:dbname=employees' -u hywan -s employees | \
      java -jar resource/plantuml.jar -verbose -pipe > output.png

Output with PostgreSQL

… MySQL

使用相同的 employees 用例

# Import the schema.
$ mysql -u root < resource/samples/mysql-employees.sql

# Generate the visualisation.
$ bin/database-to-plantuml -d 'mysql:dbname=employees' -u root -s employees | \
      java -jar resource/plantuml.jar -verbose -pipe > output.png

Output with MySQL

注意:输出不同,因为 employees 示例并不完全相同。它们在这里只是为了说明工具。

许可

BSD-3 许可证,但说真的,做你想做的任何事情吧!