Hongmu Notes

🗄️ SQL formatting

Beautify or compress SQL statements with one click and replace content in place.

SQL formatting

Instructions for use

  • Paste SQL into the input box and click "Format SQL" or "Compress SQL"
  • The result will be written back to the input box on the spot. It is recommended to make a backup copy of the original text first.
  • Formatting only adjusts whitespace and line breaks, but does not change the statement itself.

SQL beautification

"Beautification" emphasizes readability: let each clause be on its own line, and the conditions are arranged in a column, so that you can locate the problem at a glance.

📌 Can I put it back after beautification?

Can. Click "Compress SQL" to reassemble multiple lines into one line. The two forms can be switched repeatedly, which is suitable for the work rhythm of reading first and then posting.

🧭 Common uses

The SQL copied from the log or monitoring is often a whole line. Formatting it first and then reading it can quickly see the table name and conditions; compressing the SQL into one line before pasting it into code, work orders or configurations can avoid unnecessary line breaks that affect typesetting. When doing code review and troubleshooting, I often switch back and forth between the two forms.

🔒 Dealing with location and privacy

Formatting and compression are completed locally in the browser. There is no Internet access, no uploading, and no writing to local storage. It will be cleared after refreshing. SQL often contains table names and field names. Please save the results according to internal specifications, and it is recommended to paste only necessary statement fragments for processing.

All keywords and tutorials 12

❓ FAQ

Will comments be added?
No. Only keep comments where there are original comments.
Can extremely long statements be processed?
Can. Several hundred lines of statements can be arranged at once.
SQL beautified checkpoints
Check whether SELECT and FROM are on separate lines, whether the brackets are aligned, and whether the comments are still in their original positions.