Read CREATE TABLE statements as a structured schema, with declared and inferred relationships kept apart, and emit TypeScript, JSON Schema, docs or a diagram.
Waiting for DDL
Paste CREATE TABLE statements. Nothing is executed and no database is contacted.
Waiting for DDL
Paste CREATE TABLE statements.
SQL Schema Inspector runs entirely on your device — nothing is uploaded, and no database is contacted.
You’re on the Free plan. Compare plans
Declared and inferred relationships are kept apart, and that separation is the point of the tool. A `REFERENCES` clause is a fact the database enforces. A column named `user_id` looking like it points at `users.id` is a guess — a good one, and still a guess, because plenty of schemas have a `user_id` that references nothing or references something else entirely.
Presenting the two together would turn a reading of your schema into a claim about it. Suggestions are listed separately with the reason they were suggested, and in the diagram they are drawn dashed, and only when you ask for them.
What the reader cannot model, it lists. A trigger, a partition clause, a stored procedure — each appears in an unsupported list with its line number, rather than being silently dropped. A schema view that quietly omits things is worse than one that admits its edges.
The TypeScript output can emit a separate insert type, which is the distinction that matters in practice: a column with a default or an identity is required when you read a row and optional when you write one. Treating them as one type is how `id` ends up mandatory on every insert.
CHECK constraints of the form `status IN ('a','b')` can become string unions, which is as close to an enum as most schemas get and is far more useful in TypeScript than `string`.
Because they are inferred from column naming rather than declared. A `user_id` column usually points at `users.id` and sometimes points nowhere. Reporting a guess as a fact would make the output untrustworthy, so guesses are listed separately and drawn dashed.
Lists it as recognised but not modelled, with its line number. Silently dropping statements would make the schema look simpler than it is, which is the opposite of useful.
Because a column with a default or an identity is required when you read a row and optional when you write one. One type for both makes `id` and `created_at` mandatory on every insert, which is wrong and annoying in equal measure.
The output is Mermaid ER syntax, which GitHub, GitLab and most documentation tools render natively. Emitting the text rather than a picture means it lives in your repository and updates in a diff.
No. It is parsed in your browser and no database is contacted, which matters because a schema names your tables, your columns and often your business.