SQLite schema diagrams from a .schema dump
Paste the output of .schema. Inline REFERENCES, IF NOT EXISTS and SQLite's typeless columns all parse.
What the parser makes of it
- 3 tables
- 10 columns
- 1 relation
CREATE TABLE IF NOT EXISTSwith double-quoted identifiers- column-level
REFERENCES "notebook"("id")with a delete action AUTOINCREMENT, and defaults that are function calls with quoted arguments- the typeless column form —
CREATE TABLE tagless (a, b, c)— which is legal in SQLite and nowhere else
The diagram
draft render, on this page's build.The file
This is the project's SQLite test fixture, in full and unedited. Everything above was produced from it.
-- SQLite: double-quoted identifiers, inline REFERENCES, and the typeless
-- column form that is legal here and nowhere else.
CREATE TABLE IF NOT EXISTS "notebook" (
"id" INTEGER PRIMARY KEY,
"title" TEXT NOT NULL UNIQUE,
"created" INTEGER DEFAULT (strftime('%s','now'))
);
CREATE TABLE IF NOT EXISTS "note" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"notebook_id" INTEGER REFERENCES "notebook"("id") ON DELETE CASCADE,
"body" TEXT NOT NULL,
"pinned" BOOLEAN DEFAULT 0
);
CREATE TABLE tagless (a, b, c);
CREATE INDEX note_notebook ON note(notebook_id);