5 tools
SQL Formatting and Generation Tools
SQL is not one language. PostgreSQL, MySQL, SQL Server, Oracle and BigQuery differ in their quoting characters, their functions, their casting syntax and their extensions. Formatting SQL well means knowing which dialect it is, because otherwise vendor syntax is treated as opaque text.
Formatting matters more for SQL than for most languages, because a query is often the densest logic in a codebase. A missing join condition or a misplaced parenthesis is nearly invisible on one long line and obvious once each clause is on its own.
Anything that manipulates SQL text has to parse string literals properly. A comment marker inside a quoted string is not a comment, and a tool that strips everything after a double dash will corrupt a literal containing one. Generating SQL has the same requirement in reverse: a value with an apostrophe must have it doubled, or the statement breaks.
SQL tools
Formatters
Working with SQL
Practical guides for the tools above, including the checks to make before relying on the result.
- How to review CSV to SQL INSERT statements
Generate and review CSV-to-SQL INSERT statements: headers, inference, NULL, booleans, dialect-specific identifier quoting, and MySQL escaping limits.
Worth understanding first
The concepts that come up most often when working with SQL.