Pikkola SQL Studio, tool No. 27

Write the schema once. Get the code that reads it.

Paste a query and read it back formatted, or paste CREATE TABLE and take TypeScript, Zod, Prisma or Pydantic out of it. The same pass marks the statements that will scan a whole table: SELECT *, a DELETE with no WHERE, a LIKE that starts with a wildcard. Nothing is uploaded. The parser is this page.

3
dialects
4
code targets
18
checks
what you paste
select o.id,u.email,count(li.id) as items
from orders o join users u on u.id=o.user_id
where o.created_at > now() - interval '7 days'
group by o.id,u.email;
what you copy
SELECT
  o.id,
  u.email,
  count(li.id) AS items
FROM orders o
JOIN users u ON u.id = o.user_id
WHERE o.created_at > now() - interval '7 days'
GROUP BY
  o.id,
  u.email;

The studio

One text, three answers

The editor is the only input. Formatting, generated code and the findings all come from it, and they update as you type.

SQL
Runs as you type. Ctrl or Cmd and Enter runs it again immediately.
Nothing leaves the tab

No request, no account, no storage. Your SQL, the generated code and the findings live in this page until you close it.

How it reads your text

Three readers share one lexer, so what the formatter shows is the same text the type generator and the checker read.

01

A formatter made for diffs

One clause per line, one column per line, CASE left on a single line. Keywords uppercased, a stable two space indent, and a one line mode for pasting into a shell or a test.

02

The schema is the only input

CREATE TABLE already carries the types, the nullability, the keys and the references. That is enough to write an interface, a schema and a model that agree with the database instead of drifting from it.

03

Eighteen checks, no score

Each finding names the line, says what happens at runtime, and gives the rewrite. There is no single number to chase, because a query can be clean and still slow.

What the checker looks for

Small rules that keep showing up in code review, in production and on the database bill. They read the text only, so a warning is a question worth asking rather than a verdict.

Line numbers count from the top of the editor. The dialect changes which checks apply.

    Questions

    Is my SQL sent anywhere?

    No. There is no endpoint to send it to. The lexer, the formatter and the schema reader are JavaScript files on this domain, and the Content-Security-Policy on this site allows no script or connection beyond its own files. Load the page once and it keeps working with the network off.

    What does the dialect change?

    The lexer and the type map. MySQL gets # comments, backticks and tinyint(1) as a boolean. SQLite gets [bracketed] names and its loose type names. PostgreSQL gets dollar quoted strings, :: casts and the serial family. Formatting of standard SQL is identical in all three.

    What happens with SQL it cannot read?

    The formatter works on tokens rather than a grammar, so an unfinished statement still comes back spaced and indented instead of throwing. The Types tab needs a real CREATE TABLE; other statements are ignored there, and the Checks tab reads both.

    How are the types decided?

    One lookup per dialect, on the column type in the DDL. int becomes number and z.number().int(), varchar becomes string, timestamptz becomes an ISO string in TypeScript and a datetime in Pydantic, a foreign key becomes a relation in Prisma. A type the map does not know comes out as unknown, so you see it instead of trusting a guess.

    Are the generated models complete?

    They cover columns, nullability, defaults, primary keys, unique columns and foreign keys. They do not invent enums, check constraints, indexes or relations to tables you did not paste. The Zod output uses z.string().date() and z.string().datetime(), which need Zod 3.23 or newer.

    Does the formatter change my SQL?

    It changes whitespace and the case of keywords only. Identifiers, string literals, numbers and the order of operators are kept as written. Comments stay where they were, and a -- comment still ends its line.