About

Tool No. 75 of Pikkola, 27 November 2026

A schema is a set of promises between tables, and the promises are written in one place: the DDL. This page reads that text, draws the promises as lines, and then reads them back to you as problems. It never connects to a database, because the text is already enough.

What it does

How the text is read

Comments are masked before anything else, and the masked copy keeps every newline, so a line number in a finding points at the line you are looking at. Strings and quoted identifiers are respected while the statements are split, which is why a semicolon inside a default value does not end a statement. A CREATE TABLE is read into columns and constraints; a table constraint is read into a key, a unique list or a foreign key; an ALTER TABLE adds to a table that was already read. Anything else is counted, not guessed.

Where the layout comes from

Each table gets a depth: zero if it has no foreign key of its own, otherwise one more than the deepest thing it points at. The deepest layer is drawn on the left and layer zero on the right, so a foreign key always leaves a child on the left and arrives at a parent on the right. Inside a layer the tables are stacked by name and centred against the tallest layer. A cycle between two tables cannot be given a depth, so the edge that closes it is ignored for layout purposes and reported instead.

What the checks are for

The checks are the questions a reviewer would ask before approving a migration. Does every table have a key. Do the two sides of a foreign key share a type family. Is the child column covered by an index whose first column is that column, because PostgreSQL will not add one for you. Does a SET NULL sit on a column that cannot be null. Does a cascade loop. None of these needs the database: they are all in the text.

What a diagram cannot say

A foreign key does not say how many children a parent usually has, and a nullable column does not say whether the null is a product decision or a forgotten constraint. Views, functions, triggers and grants are not drawn. An index that a managed service did not print in the DDL is not in the model either, so the unindexed warning is a question about the text you pasted, not a verdict about your database.

The exports

Mermaid writes the model as a diagram a Markdown file can render; DBML writes it for dbdiagram and the tools that read that format; JSON writes every table, column, key and issue so a script can check the promise later. SVG and PNG are drawn from the model rather than the canvas, so the file does not depend on where you dragged a box before taking it.

What it is not

It is not a database client and not a migration generator. It does not connect, does not execute, does not compare two schemas against each other and does not infer a schema from data. It cannot tell you whether a managed service has an index the DDL does not show. It reads the text in front of it and names what it could not check.

Contact

A dialect this page reads wrongly, or a statement it should understand, is worth a message with the snippet: hello@pikkola.com.

Back to the studio