DEV Community

Cover image for Document your database
Claudio Altamura
Claudio Altamura

Posted on • Originally published at claudioaltamura.de

1

Document your database

Simply and easily with SchemaSpy

It has never been easier to document you db. SchemaSpy analyzes your database with tables, columns, types and indexes. It even creates diagrams with relationships of your existing database.

The installation is super easy. You just have to download SchemaSpy https://github.com/schemaspy/schemaspy/releases and your database driver. Even Graphviz is no longer required. The configuration is really simple. Here I show a config.

# type of database. Run with -dbhelp for details
schemaspy.t=mysql
# optional path to alternative jdbc drivers.
schemaspy.dp=mysql-connector-java-8.0.22
# database properties: host, port number, name user, password
schemaspy.host=localhost
schemaspy.port=3306
schemaspy.db=db
schemaspy.u=root
schemaspy.p=password
# output dir to save generated files
schemaspy.o=doc
# db scheme for which generate diagrams
schemaspy.s=db
# run with java -jar schemaspy-6.1.0.jar -configFile config.properties

You run the tool with "java -jar schemaspy-6.1.0.jar -configFile config.properties". Then you get a HTML documenation and the diagrams look like this.

relationship

And a really cool trick is to integrate SchemaSpy in your CI/CD pipeline.

I really like this tool.

Postgres on Neon - Get the Free Plan

No credit card required. The database you love, on a serverless platform designed to help you build faster.

Get Postgres on Neon

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs