Giter VIP home page Giter VIP logo

database-to-plantuml's Introduction

Database to PlantUML

This utility renders a graphical 2D visualisation of a database.

Currently, the only supported frontends are PostgreSQL and MySQL. There are 2 backends: commonmark and plantuml. The plantuml backend allows to generate visualisations into the following formats:

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

Installation

With Composer, simply run the following command:

$ composer install

If you would like to use it as a dependency of your project, then:

$ composer require hywan/database-to-plantuml

To use the plantuml backend, you can use the JAR in resource/plantuml.jar.

Examples with…

… PostgreSQL

Taking as an example the famous employees use case:

# 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

With the same employees use case:

# 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

Note: Outputs differ because the employees examples are not exactly the same. They are here to illustrate the tool only.

License

BSD-3-License, but seriously, do what ever you want!

database-to-plantuml's People

Contributors

allyorange avatar headd2k avatar hywan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

database-to-plantuml's Issues

Postgresql : "could not find driver" error

When I try to export my database I got this error :

~/src/Database-to-PlantUML (master)$ bin/database-to-plantuml -d 'pgsql:dbname=employees' -u api -s employees
could not find driver

What I've done :
git clone https://github.com/Hywan/Database-to-PlantUML.git
cd Database-to-PlantUML/
composer install
psql -h localhost -U api -d api -f resource/samples/pgsql-employees.sql

Everything goes well, and the datas are in the db,

Does the posgresql has to be installed elsewhere ?

Width/Height too large

When attempting to create a visualization from my DB schema, I receive the following error(s):

(0.000 - 245 Mo) 237 Mo - PlantUML Version 1.2017.14
(0.003 - 245 Mo) 237 Mo - GraphicsEnvironment.isHeadless() false
(5.262 - 696 Mo) 168 Mo - Starting Graphviz process [/usr/local/bin/dot, -Tsvg]
(5.262 - 696 Mo) 168 Mo - DotString size: 83014
(5.612 - 996 Mo) 929 Mo - Ending process ok
(5.612 - 996 Mo) 929 Mo - Ending Graphviz process
(10.137 - 1514 Mo) 608 Mo - Width too large 25878
(10.137 - 1514 Mo) 608 Mo - Height too large 5582
(10.137 - 1514 Mo) 608 Mo - Creating image 4096x4096
(14.694 - 1595 Mo) 858 Mo - Ok for com.sun.imageio.plugins.png.PNGMetadata

The created image is in fact 4096x4096, cutting off a good portion of the schema/diagram.

Phar

Hi there,

Great tools 👍

Are you interested in the integration of PHAR build?

I'm able to submit you're a PR with this the tools need to do that.
even an integration with ContinuousPHP to automatically build and publish PHAR on Github release if you want it :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.