Skip to content

Category · 1 tool · 1 guide

SQL and database tools

SQL has been the language of relational databases for decades, and it is still how most applications store and query their data. Developers write it directly in migrations and reports, read it in ORM debug logs, and paste it into tickets when a query is slow. Most of that SQL arrives badly formatted: a single long line from a log, a query generated by a framework, or a script written in a hurry.

Readable SQL is not just cosmetic. When each clause, join and condition sits on its own line, it is much easier to see a missing join condition that creates a cartesian product, an OR that should have been inside parentheses, or a filter applied after a GROUP BY instead of before it. Consistent formatting also makes migration diffs reviewable.

The tools here understand the major SQL dialects, so dialect-specific syntax such as PostgreSQL casts or MySQL backticks is handled correctly. Queries are formatted in your browser and never sent anywhere, which matters when they contain table names or data from production.

Tools in this category

Common tasks

Key concepts

Dialect
Each database extends standard SQL differently. Identifier quoting, LIMIT versus TOP, string concatenation and JSON functions all vary, so formatters and linters need to know the target database.
JOIN types
INNER JOIN keeps only matching rows, LEFT JOIN keeps every row from the left table, and a missing ON condition produces a cross join of every row with every other row.
Parameterised query
A query with placeholders such as $1 or ? whose values are sent separately. It prevents SQL injection and lets the database reuse the query plan.
Execution plan
The steps the database chooses to run a query, shown by EXPLAIN. It reveals whether an index is used or the whole table is scanned.
CTE
A common table expression, written WITH name AS (...), gives a subquery a name. It makes long queries readable by breaking them into named steps.

Best practices

  1. Always use parameterised queries; never build SQL by concatenating user input into strings.
  2. Put each selected column, join and condition on its own line so diffs and reviews stay precise.
  3. Name columns explicitly instead of SELECT * in application code, so schema changes do not silently alter results.
  4. Run EXPLAIN on new queries against realistic data volumes before shipping them.
  5. Format SQL in migrations consistently and keep each migration small and reversible.

Guides