What this SQL formatter does
It re-flows SQL into a consistent, reviewable layout, or squeezes it onto one line per statement. A tokenizer written for this page reads your query the way the chosen database would: which characters quote identifiers, which start comments, how strings escape quotes and what counts as a parameter. The formatter then rebuilds the whitespace around those tokens.
Only two things ever change: whitespace and the case of SQL keywords. Table and column names, string literals, quoted identifiers, comments and PostgreSQL dollar-quoted function bodies are written back exactly as you typed them. That makes the output safe to paste straight back into a migration, a dbt model or a stored procedure.
It is a layout tool, not a full SQL parser, so it does not rewrite queries or check that a column exists. Your database is still the final judge of correctness, as described in our PostgreSQL indexing guide when you move on to EXPLAIN.