Skip to content

terraware/schemaspy

 
 

Repository files navigation

Logotype

Maven Central Docker Pulls Development Documentation Status Quality Gate Coverage Gitter

SchemaSpy is a database metadata analyzer. It helps your database administors and developers visualize, navigate and understand your data model. With an easy-to-use HTML-based report, traversing the entity-relationship diagram has never been simpler. Our product showcase is available at http://schemaspy.org/sample/index.html.

SchemaSpy sample

Installation

SchemaSpy is a stand alone tool. Just download the lastest JAR file or Docker image and you're ready to go!

curl -L https://github.com/schemaspy/schemaspy/releases/download/v6.2.4/schemaspy-6.2.4.jar \
    --output ~/Downloads/schemaspy.jar

For unreleased bug fixes and features-in-progress, download our snapshot JAR or use Docker tag snapshot

Quick start

Let's assume you're using PostgreSQL (11 or later). First, download their JDBC driver.

curl -L https://jdbc.postgresql.org/download/postgresql-42.5.4.jar \
    --output ~/Downloads/jdbc-driver.jar

Then run SchemaSpy against your database and you're ready to browse it in DIRECTORY/index.html.

java -jar ~/Downloads/schemaspy.jar \
    -t pgsql11 \
    -dp ~/Downloads/jdbc-driver.jar \
    -db DATABASE \
    -host SERVER \
    -port 5432 \
    -u USER \
    -p PASSWORD \
    -o DIRECTORY

If you aren't using PostgreSQL, don't panic! Out of the box, SchemaSpy supports over a dozen different databases. List them by using -dbhelp. Still not enough? As long as your database has a JDBC driver you can plug it in to SchemaSpy.

Documentation and FAQs

We host our documentation on Read the Docs. Be sure to check out the section on troubleshooting common problems.

Main use cases

SchemaSpy covers a lot of use cases for database analysis and documentation. Be sure to check out the guides provided by the community later in this README.

On-demand database documentation

The prefered way to document databases is through entity-relationship (ER) diagrams. However, drawing these diagrams manually is such a time-consuming and error-prone process that we hardly ever draw them in practice. When the diagrams are drawn, they rarely stay up-to-date. With SchemaSpy, this is no longer a problem. The diagrams can be generated quickly and even as a part of your CI/CD workflow to ensure it's always up to date.

Your database in numbers

SchemaSpy can collect various kinds of interesting statistics to describe the shape and form of your database's structure. Drill down deeper into these statistics directly in the report or export them to excel or CSV for further QA analysis.

Keep the data confidential

Nowadays, a company's data can be their most valuable asset. Since SchemaSpy only reads structural information, it works just as well on an empty database replica. This means that the report can be shared for third party analysis without fear.

Detect sub-optimal constructs

SchemaSpy incorporates knowledge about best practices in database design. It can locate and report anomalies such as missing indexes, implied relationships, and orphan tables.

Community

Welcome to the SchemaSpy community! Just reading this file or using the tool means that you're a part of our community and contributing to the future of the project. We're grateful to have you with us!

Some of our community members have put extra effort into sharing SchemaSpy with more people, asked their companies to provide financial aid, or decided to improve the software. We wish we had the space to thank each of you individually because every Github star, tweet or other activity reminds us that our work is appreciated.

Special thanks

For creating the first five versions of SchemaSpy:

For perpetuating SchemaSpy ever since:

For creating tutorials and guides for the community:

Scientific usage

We are proud to note that SchemaSpy assists researchers in their work.

To cite SchemaSpy, please use:

SchemaSpy Team (2023) SchemaSpy: Database documentation built easy. SchemaSpy. URL https://schemaspy.org/

The BibTeX entry for LaTeX users is:

@Manual{schemaspy,
  title = {SchemaSpy: Database documentation built easy},
  author = {{SchemaSpy Team}},
  organization = {SchemaSpy},
  year = {2023},
  url = {https://schemaspy.org/}
}

Build Instructions

Application

SchemaSpy is built using maven and we utilize the maven wrapper.
Windows mvnw.cmd package
Linux ./mvnw package
The resulting application can be found in target

Analyzing

You need your own SonarQube:
https://hub.docker.com/_/sonarqube/
Windows mvnw.cmd -P sonar clean verify -Dsonar.host.url=http://$(boot2docker ip):9000 -Dsonar.jdbc.url="jdbc:h2:tcp://$(boot2docker ip)/sonar"
Linux ./mvnw -P sonar clean verify

Watch results at:
Linux http://localhost:9000
Windows http://$(boot2docker ip):9000

Documentation

Built using Python
Create venv
Install dependencies pip install -r docs/requirements.txt
Navigate into docs
Windows make.bat clean && make.bat html
Linux make clean html
The resulting documentation can be found in docs/build/html

Releases

No releases published

Packages

No packages published

Languages

  • HTML 41.2%
  • Java 36.5%
  • JavaScript 18.0%
  • CSS 2.5%
  • PLpgSQL 1.7%
  • Dockerfile 0.1%