DEV Community

Sualeh Fatehi
Sualeh Fatehi

Posted on • Edited on

4

How to Visualize Your SQLite Database with One Command (and Nothing to Install)

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

You can generate PDF files, and other types of output too. Go through the SchemaCrawler tutorials on Katacoda to learn more SchemaCrawler commands.

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 👀

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (10)

Collapse
 
sualeh profile image
Sualeh Fatehi

@adriens - are you referring to this article?

Collapse
 
adriens profile image
adriens

Exactly what I needed !!!

Collapse
 
adriens profile image
adriens

Indeed ;-p

Collapse
 
adriens profile image
adriens

I want the next episode 🤓

Collapse
 
adriens profile image
adriens

Go to killercoda.com/schemacrawler for up-to-date Schemacrawler course

Collapse
 
adriens profile image
adriens

Could you also please add the html, pdf options to your post ?

Collapse
 
adriens profile image
adriens

.... also should be migrate/updated to Kilelrcoda LOL

Collapse
 
adriens profile image
adriens

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) _ ?

ro_prop.setProperty("duckdb.read_only", "true");
Connection conn_ro = DriverManager.getConnection("jdbc:duckdb:/tmp/my_database", ro_prop);
Enter fullscreen mode Exit fullscreen mode

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

Collapse
 
adriens profile image
adriens
Collapse
 
adriens profile image
adriens

Hi @sualeh : could you please provide us the killercoda version ?

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay