What is SQLite Schema Diagram Generator?
SQLite Schema Diagram Generator is a SQLite schema diagram generator built with Makefile, to help get a quick overview of your database schema without installing a large complex tool.
A properly normalised database can wind up with a lot of small tables connected by a complex network of foreign key references. Like a real-world city, it's pretty easy to find your way around once you're familiar, but when you first arrive it really helps to have a map.
Lots of database management tools include some kind of schema diagram view, either automatically generated or manually editable so you can get the layout just right. But it's usually part of a much bigger suite of tools, and sometimes I don't want to install a tool, I just want to get a basic overview quickly.
How it works:
The sqlite-schema-diagram.sql file contains a query which returns a sequence of strings, representing a SQLite database's schema in GraphViz format. You can save it to a file, or just pipe it to the GraphViz dot
command to convert it to your favourite output format: PNG, SVG, PDF, whatever.
Note: sqlite3
is invoked with the -init
option that tells it to read a file at startup, and an empty query string that makes it start up in non-interactive mode. That turns off any extra output formatting sqlite3
might do that would interfere with the GraphViz syntax.