Created
February 7, 2024 15:08
-
-
Save gaardhus/9692a25cc8a1cf10017850c7751f096b to your computer and use it in GitHub Desktop.
Create an ERD from a sqlite database using schemaspy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db-name=database | |
path-to-db=./data | |
db-ext=sqlite | |
output-directory=./docs/diagrams | |
output-file=diagram.png | |
db-diagram: | |
schemaspy -dp /usr/share/java/sqlite-jdbc/ \ | |
-t sqlite-xerial \ | |
-cat ${db-name} -s ${db-name} -db ${path-to-db}/${db-name}.${db-ext} \ | |
-sso -o /tmp/schemaspy/ && \ | |
mkdir --parents $(output-directory); mv /tmp/schemaspy/diagrams/summary/relationships.real.large.png ${output-directory}/${output-file} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment