Guides

SQL formatting workflow

How to format SQL queries for review, debugging, and readable diffs.

Format for review, not for execution

A SQL formatter makes a query easier to read, but it does not prove safety, performance, or correctness. Treat formatted SQL as a review artifact that still needs database-specific validation.

  • Check the dialect before trusting keyword layout.
  • Keep literals redacted when sharing output.
  • Review behavior in the real database before running mutations.

Read the query type first

SELECT, INSERT, UPDATE, DELETE, ALTER, and DROP statements carry different risk. A formatter should make the query type, table references, joins, filters, limits, and subqueries easier to inspect.

  • Mutation queries need a WHERE review.
  • SELECT queries need table, join, and limit review.
  • Schema changes need an explicit migration process.

Use formatting to find missing clauses

Compact SQL can hide a missing WHERE clause, cross join, broad wildcard, or unbounded query. After formatting, scan each clause in order and compare the output to the original input.

  • Check WHERE and LIMIT before sharing a data query.
  • Check JOIN conditions for accidental cartesian results.
  • Check subqueries for hidden filters or expensive scans.

Protect sensitive identifiers

Queries often include customer IDs, emails, table names, tenant IDs, or internal schema details. Redact those values before using an online formatter in a ticket, chat, or public documentation.

  • Replace emails and IDs with stable placeholders.
  • Keep table aliases if they are needed to understand joins.
  • Avoid pasting real credentials in connection strings.

Compare query revisions with diff

After formatting a query, Text Diff can show whether only whitespace changed or whether a condition moved. CSV conversion can help inspect query result samples without turning the SQL page into a database client.

  • Diff formatted before-and-after versions.
  • Use CSV JSON Converter for small exported result samples.
  • Use JSON Formatter when query results come from an API response.

Before copying

A short review loop for safer reuse

SQL Formatter

Format SQL queries for readable reviews and debugging.

Code

Use cases

  • Pretty-print compact SQL and copy a query review report before running it.
  • SQL Formatter for code workflows

Common failure cases

  • Formatting makes SQL readable but does not prove the query is safe or efficient.
  • Dialect-specific syntax can be rearranged differently from the database formatter.
  • Copied production literals can expose customer IDs, emails, or internal table names.

Before copying

  • Review the formatted query against the original before running it.
  • Redact literals and internal identifiers before sharing the formatted SQL.
  • Use Text Diff when comparing query revisions after formatting.

Examples

Common input

Pretty-print compact SQL and copy a query review report before running it.

select id,name from users where active=1 order by created_at desc

Typical output

Use this as a quick sanity check before copying results.

Formatted SQL plus query type, table references, clause checks, warnings, and review checklist

Join review

Formats table aliases, join condition, and filter clauses for review.

select u.id,o.total from users u join orders o on o.user_id=u.id where o.status='paid'

FAQ

Does SQL Formatter upload my input?

No. This tool runs in your browser unless the privacy badge explicitly says a server route is required.

Can I use this for production secrets?

Avoid pasting sensitive production data into any website. Prefer local test data or redacted payloads.

Does formatting make SQL safe?

No. Formatting improves readability only. Review query type, WHERE clauses, joins, parameters, and database behavior before running it.

Text Diff

Compare two text blocks with line or word level differences.

Text

Use cases

  • Paste two versions to see added and removed lines or words.
  • Text Diff for text workflows

Common failure cases

  • Text Diff can still fail when the pasted input shape differs from before text / after text.
  • The output should be reviewed in the target text workflow before reuse.
  • Browser-local processing does not make sensitive production data safe to paste.

Before copying

  • Compare the output against the original input before copying.
  • Remove secrets, customer data, and one-off environment values.
  • Continue with json-formatter if the result needs another validation step.

Examples

Common input

Paste two versions to see added and removed lines or words.

before text / after text

Typical output

Use this as a quick sanity check before copying results.

- old line + new line

FAQ

Does Text Diff upload my input?

No. This tool runs in your browser unless the privacy badge explicitly says a server route is required.

Can I use this for production secrets?

Avoid pasting sensitive production data into any website. Prefer local test data or redacted payloads.

CSV JSON Converter

Convert CSV rows to JSON arrays, JSON arrays back to CSV, and clean messy spreadsheet exports.

Data

Use cases

  • Convert or clean spreadsheet exports and API fixtures.
  • CSV JSON Converter for data workflows

Common failure cases

  • CSV JSON Converter can still fail when the pasted input shape differs from id,name,role 1,Bob,admin 2,Alice,editor.
  • The output should be reviewed in the target data workflow before reuse.
  • Browser-local processing does not make sensitive production data safe to paste.

Before copying

  • Compare the output against the original input before copying.
  • Remove secrets, customer data, and one-off environment values.
  • Continue with json-formatter if the result needs another validation step.

Examples

Common input

Convert or clean spreadsheet exports and API fixtures.

id,name 1,Bob

Typical output

Use this as a quick sanity check before copying results.

[{"id":"1","name":"Bob"}]

Messy export

Trims cells and exposes duplicate rows before conversion.

id , name , status 1 , Bob , active 1 , Bob , active

FAQ

Does CSV JSON Converter upload my input?

No. This tool runs in your browser unless the privacy badge explicitly says a server route is required.

Can I use this for production secrets?

Avoid pasting sensitive production data into any website. Prefer local test data or redacted payloads.

What gets lost when CSV becomes JSON?

CSV is flat table data, so nested objects, arrays, types, and empty values need explicit review after conversion.

SQL formatting workflow | bobob.app