SQL Formatter Options

White Spaces

The White Spaces settings in the SQL Formatter Tool allow you to control the use of white spaces in your SQL scripts. These options help enhance readability, reduce unnecessary spaces, and maintain a clean, structured format.

Sql Formatter Options Alignment

General Indention

  1. Keep 1st Line Indention

    • Retains the indentation of the first line of the SQL statement, ensuring that initial formatting is preserved.
  2. Add Initial Indention

    • Specifies the number of spaces or tabs to add as an initial indentation for all SQL statements.
    • Use the -4 and +4 buttons to decrease or increase the indentation incrementally.

White Spaces

  1. Around Commas

    • Controls how white spaces are handled around commas in SQL lists (e.g., in SELECT or VALUES clauses).
    • Options:
      • Keep unchanged: Retains the original spacing around commas.
      • Add space: Ensures a space is added after each comma.
      • Remove space: Removes any space around commas.
  2. Around Brackets

    • Adjusts the spacing around parentheses or square brackets in SQL statements.
    • Options:
      • Keep unchanged: Retains the original spacing.
      • Add space: Adds a space around brackets.
      • Remove space: Removes all spaces around brackets.
  3. Around Operators

    • Defines the spacing around SQL operators (e.g., =, +, -, AND, OR).
    • Options:
      • Keep unchanged: Maintains the existing spacing.
      • Add space: Adds spaces around operators.
      • Remove space: Removes any spaces around operators.
  4. Blank Lines

    • Manages blank lines in the SQL script.
    • Options:
      • Keep unchanged: Retains the original blank lines.
      • Keep one: Ensures only one blank line between sections.
      • Keep none: Removes all blank lines.

Additional Options

  1. Remove Unnecessary White Spaces

    • Automatically detects and removes extra or redundant white spaces throughout the SQL script.
  2. Remove White Space Before ]

    • Removes any spaces immediately preceding the closing square bracket (]).
    • Useful for cleaning up array or indexed column references.

.