SchemaCrawler - Diagram Example
Description
The diagram example demonstrates the integration of SchemaCrawler with Graphviz.
How to Run
- Make sure that java is on your PATH
- Start a command shell in the
_downloader
directory - Run
download.cmd javascript
(ordownload.sh javascript
on Unix) to install the JavaScript support package required forgraphviz-java
- Run
download.cmd graphviz-java
(ordownload.sh graphviz-java
on Unix) to install thegraphviz-java
package - The
graphviz-java
package only supports PNG and SVG output. For other types of output, install Graphviz.
Run With SQLite Database
- Start a command shell in the diagram example directory
- Run
sqlite_diagram.cmd ..\..\_testdb\sc.db sc.pdf
(orsqlite_diagram.sh ../../_testdb/sc.db sc.pdf
on Unix)
Run With HyperSQL Database
- Start the test database server by following instructions in the
_testdb/README.html
file - Start a command shell in the diagram example directory
- Run
diagram.cmd database-diagram.png
(ordiagram.sh database-diagram.png
on Unix)
How to Experiment
- Try other output formats like PDF by changing the extension of the output file
- Try using grep options to include certain tables. For example, try using a command-line option of
--grep-columns=.*\\.AUTHOR.*
- Try controlling display of foreign-key names, column ordinal numbers, and schema names by setting the following properties in the SchemaCrawler configuration file,
config/schemacrawler.config.properties
.
schemacrawler.format.show_ordinal_numbers=true
schemacrawler.format.hide_foreignkey_names=true
schemacrawler.format.hide_weakassociation_names=true
schemacrawler.format.show_unqualified_names=true
- Try using Graphviz command-line options by setting the following property in the SchemaCrawler configuration file,
config/schemacrawler.config.properties
.
schemacrawler.graph.graphviz_opts=-Gdpi=300
SchemaCrawler Web Application
Take a look at the SchemaCrawler Web Application.