draft

SQLite schema diagrams from a .schema dump

Paste the output of .schema. Inline REFERENCES, IF NOT EXISTS and SQLite's typeless columns all parse.

Open the app

What the parser makes of it

The diagram

notebook id integer PK title text UQ created integer note id integer PK notebook_id integer FK body text pinned boolean IX note_notebook (notebook_id) tagless a b c
Drawn from the file below by 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);