SQL Schema Diagrammer
Turn a supported SQLite CREATE TABLE script into an original table-and-key SVG diagram with complete source and foreign-key mapping evidence.
Loading tool…
How to use SQL Schema Diagrammer
Share a small relational schema without connecting to a database. Supply supported CREATE TABLE declarations, then download a vector diagram with every column, declared primary or unique key and local foreign-key mapping. The JSON keeps the original DDL and exact clause positions. The tool parses a closed declaration profile and refuses unsupported syntax together.
- Paste your supported CREATE TABLE declarations or choose a complete UTF-8 file. Select a literal title and output format.
- Run the parser. Review all declared columns and keys, including missing-reference refusals. Arrows point from child fields toward declared parent keys.
- Download the standalone SVG for deliberate viewing, or JSON for the whole original DDL, source spans and geometry. Nothing opens a database or changes the original file.
Good to know
- Selected SQLite-compatible declarations only: CREATE TABLE name (...), with columns before table constraints. Semicolons separate statements; the final semicolon is optional. One initial UTF-8 BOM, SQLite ASCII whitespace, -- line comments and terminated non-nesting /* block comments */ are supported. Unknown syntax refuses the entire run; a refusal is not a claim that otherwise-valid SQLite is invalid.
- Use unquoted ASCII identifiers or double-quoted names with doubled-quote escaping. Reserved SQLite keywords must be quoted in this profile; table names beginning sqlite_ are reserved and refused. Names require 1–40 UTF-16 units and at most 48 conservative columns; controls, bidi formatting and Unicode line/paragraph separators are unsupported. ASCII identifier case is ignored for lookup; Unicode is retained without normalization. Bracket, backtick and single-quoted identifier compatibility forms are unsupported.
- Supported common type names: INT, INTEGER, TINYINT, SMALLINT, MEDIUMINT, BIGINT, INT2, INT8, TEXT, CLOB, BLOB, REAL, DOUBLE, DOUBLE PRECISION, FLOAT, NUMERIC, DECIMAL, BOOLEAN, DATE, DATETIME, CHAR, CHARACTER, VARCHAR, NVARCHAR and NCHAR. Typeless columns stay unspecified. Character types accept a size 1–65,535; NUMERIC/DECIMAL accept precision 1–65,535 and optional scale 0–65,535. Each parameter spelling has at most six decimal digits, retaining leading zeros within that bound. These are declaration spellings, not storage, precision or data-validation guarantees.
- Inline or table PRIMARY KEY and UNIQUE, explicit NULL/NOT NULL, inline/table REFERENCES and optional named CONSTRAINT labels are modeled. Composite tuples have at most four columns. Every parent must be declared locally; its referenced tuple must match a complete declared primary/unique key, with no external or partial index. Omitted parent columns resolve only to its declared primary key. Forward references, self references and reference cycles are supported. Duplicate key occurrences remain separate; at most one primary key declaration per table is allowed.
- No TEMP, VIRTUAL, IF NOT EXISTS, schema-qualified names, AS SELECT, DEFAULT, CHECK, COLLATE, GENERATED, key sort modifiers, conflict clauses, reference actions/DEFERRABLE, STRICT/WITHOUT ROWID, indexes, views, triggers, data statements or custom type expressions are interpreted. No source is submitted to a database engine. No migration, rowid alias, data cardinality, implicit NOT NULL, stored-row consistency or full SQL validity is inferred.
- Bounds: 20,000 UTF-16 source units, 80,000 UTF-8/file bytes, 10,000 tokens, 12 tables, 20 columns per table/240 total, 48 primary/unique keys and 24 foreign keys. File reading has a 5-second wait limit; the module Worker has 10 seconds to prepare and a separate 2-second computation deadline. Whole SVG and JSON jointly fit 2,000,000 UTF-16 units and UTF-8 bytes before either returns.
- The original SVG uses fixed source-order vertical table boxes and exterior reference rails, not an optimized graph layout. Arrows connect the first fields of composite tuples; the complete numbered tuple schedule is authoritative. Crossings are not junctions. SVG text remains literal and has no scripts, user markup, external links, images or fonts. Viewers may use different fonts; zoom and review all labels before sharing. The website does not mount the SVG or create a 3D/database viewer.
- JSON includes the complete original source, including private comments. The SVG omits raw comments but prints declared names and keys, so neither output is anonymous. No filename enters the report. No network request, code execution, database connection or automatic persistent history is used. Pagehide stops waiting and prevents a late read from starting a Worker; it does not abort a browser's physical File read. Reset discards the current UI result and does not promise immediate cancellation of already running work.
Common questions
Can this import an existing database or run CREATE TABLE?
No. It only parses the supplied declaration text. Use SQLite Snapshot Schema Inspector to read selected stored schema from a local database snapshot. This tool creates a diagram; it neither opens a database engine nor changes schema or records.
Why did a valid SQL dump get refused?
A dump can contain data, triggers, indexes, actions and dialect-specific syntax outside this closed profile. Unsupported content refuses the complete run instead of being silently discarded. Supply only declarations matching the documented grammar; a refused dump is not a database validity verdict.
Why is a primary key not automatically marked NOT NULL?
This report distinguishes explicitly declared constraints. SQLite has special primary-key and rowid behavior that depends on the complete table form. The diagram does not convert a PK marker into an inferred nullability or data-cardinality promise.
What does a foreign-key line prove?
It shows the exact declared child-to-parent field mapping and an included parent key. It does not prove that rows exist, constraints are enabled, a migration will succeed or a live database has the same schema.
Keep going with related tools
All developer →SQLite Snapshot Schema Inspector
Read schema objects and selected file-header metadata from a bounded standalone SQLite rollback-journal snapshot without executing SQL.
DataCSV Foreign Key Checker
Check child records against unique parent composite keys with explicit blank-key handling.
DeveloperSQL Formatter
Format SQL queries with a selected dialect and consistent uppercase keywords, without connecting to a database.
DeveloperSupported Schema to TypeScript
Translate declared schema structure into a TypeScript source type with explicit runtime-constraint caveats.