Ever wondered what the tables in your SQLite database look like, and how they are related to each other? Generate a diagram of your SQLite database with one command. You can run this on any system that has Docker installed.
On a Linux system, run a command like:
docker run \
--mount type=bind,source="$(pwd)",target=/home/schcrwlr \
--rm -it \
schemacrawler/schemacrawler \
/opt/schemacrawler/bin/schemacrawler.sh \
--server=sqlite \
--database=chinook-database-2.0.1.sqlite \
--info-level=standard \
--command=schema \
--output-file=output.png
The command assumes that a SQLite database called "chinook-database-2.0.1.sqlite" is in your current directory. A file called "output.png" will be generated with the database schema, including columns, data-types, and foreign key relationships.
If you are using PowerShell on Windows, replace the trailing backslash on each line with a back-tick, and map the current directory differently. Run this command:
docker run `
--mount type=bind,source="${PWD}",target=/home/schcrwlr `
--rm -it `
schemacrawler/schemacrawler `
/opt/schemacrawler/bin/schemacrawler.sh `
--server=sqlite `
--database=chinook-database-2.0.1.sqlite `
--info-level=standard `
--command=schema `
--output-file=output.png
You can generate PDF files, and other types of output too. Go through the SchemaCrawler tutorials on Katacoda to learn more SchemaCrawler commands.
Top comments (10)
@adriens - are you referring to this article?
Exactly what I needed !!!
Indeed ;-p
I want the next episode 🤓
Go to killercoda.com/schemacrawler for up-to-date Schemacrawler course
Could you also please add the
html
,pdf
options to your post ?.... also should be migrate/updated to Kilelrcoda LOL
here is some additional inspiration for your collection :
📝 Write DEV.to > How to Visualize Your DuckDb Database with One Command (and Nothing to Install) #1015
Description
In the same way you wrote How to Visualize Your SQLite Database with One Command (and Nothing to Install) , could you use DuckDb jdbc driver to write a dedicated DEV.to article called _How to Visualize Your DuckDb Database with One Command (and Nothing to Install) _ ?
jdbc
driver on Maven Centralorg.duckdb.DuckDBDriver
How to Reproduce
No response
Relevant log output
No response
SchemaCrawler Version
latest
Java Version
current LTS
Operating System and Version
Docker
Relational Database System and Version
DuckDb
JDBC Driver and Version
current
Hi @sualeh : could you please provide us the killercoda version ?