https://github.com/nextbreakpoint/schema2dot
Generate a graph in dot format from a database schema
https://github.com/nextbreakpoint/schema2dot
Last synced: about 2 months ago
JSON representation
Generate a graph in dot format from a database schema
- Host: GitHub
- URL: https://github.com/nextbreakpoint/schema2dot
- Owner: nextbreakpoint
- Created: 2019-03-07T17:47:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-20T17:33:12.000Z (about 6 years ago)
- Last Synced: 2025-01-18T14:47:26.056Z (3 months ago)
- Language: Java
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# schema2dot (experimental)
Generate a graph file in dot format from a database schema.
## How to use
Run Postgres database using Docker:
docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=password -d postgres
Create an empty database:
docker run -it --rm -v $(pwd):/script --link some-postgres:postgres postgres psql -h postgres -U postgres -c "create database test"
Create tables and constraints from a DDL file:
docker run -it --rm -v $(pwd):/script --link some-postgres:postgres postgres psql -h postgres -U postgres -d test -f /script/ddl.sql
Create or edit the configuration file:
cat test.properties
jdbc.url=jdbc:postgresql://localhost/test
jdbc.username=postgres
jdbc.password=passwordBuild the schema2dot command (requires Maven):
mvn clean package
Generate the graph from the database schema:
java -jar target/com.nextbreakpoint.schema2dot-1.0.jar test.properties
Generate a PNG image from the graph (requires Graphviz):
dot -Tpng graph.dot > graph.png
Generate a SVG image from the graph (requires Graphviz):
dot -Tsvg graph.dot > graph.svg