Why do I need to pick a dialect before formatting?
Because each database engine quotes identifiers differently: backticks in MySQL, brackets in SQL Server, double-dollar in PostgreSQL. The formatter uses the chosen dialect to know where a quoted identifier starts and ends, and picking the wrong dialect can make that quoting get read as plain code.
Does the formatter reformat the text inside a string?
No. The tokenizer identifies where every string literal, line comment, or block comment starts and ends before applying any indentation, so the text content inside them reaches the final result intact, byte for byte.
What is the difference between trailing and leading comma style?
Trailing comma (the default) puts the comma at the end of each column line; leading comma moves the comma to the start of the following line. The result runs identically in the database, it is purely a visual preference that makes it easier to see what changed in a version-control diff.
What happens if I format broken SQL text?
The tokenizer never throws an error on its own: an unterminated string or comment is read through to the end of the text and flagged internally as unterminated, so the result degrades back to the original text instead of crashing or truncating content.