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
- Read a query from an ORM logPaste the single-line SQL your framework logged and format it to see the joins and filters it actually runs.
- Agree on a team SQL styleKeyword case, indentation, aliases and comma placement rules that keep queries consistent and reviewable.
- Review a migration changeFormat the old and new version of a script the same way, then diff them to see what really changed.
- Generate test data for insertsCreate UUID primary keys in bulk for seed scripts and fixtures.
- Inspect exported query resultsOpen a CSV export of a result set as a sortable, searchable table.
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
- Always use parameterised queries; never build SQL by concatenating user input into strings.
- Put each selected column, join and condition on its own line so diffs and reviews stay precise.
- Name columns explicitly instead of SELECT * in application code, so schema changes do not silently alter results.
- Run EXPLAIN on new queries against realistic data volumes before shipping them.
- Format SQL in migrations consistently and keep each migration small and reversible.