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 typesetting check

The most important thing to confirm after typesetting is that "the statements have not been changed": it is safest to check the keywords and conditions one by one.

📌 How to check quickly

First make a backup copy of the original text, and then compare the keyword sequences, field lists, and conditional expressions on both sides after formatting; if they are completely consistent, it means that only the blanks have been changed, and you can use it with confidence.

🧭 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

Can it be compared automatically?
No. This page is only for typesetting. Please compare manually or use text comparison tools.
What happens if typesetting fails?
A prompt will be displayed on the status line that the parsing failed, and the content of the input box will remain unchanged.
Check priority
First look at the keyword sequence → then look at the fields and conditions → finally make sure the comments are still there.