SQL Formatter Options
Options
SQL Alignment
The SQL Alignment Options in the SQL Formatter Tool allow you to customize the indentation and alignment of SQL keywords and clauses. This ensures your SQL code is structured, readable, and adheres to specific formatting styles such as the Axis River Concept.
Indentation
- SQL Indention
- Allows you to set the type of indentation applied to the SQL script (e.g., spaces or tabs).
General Indention
- Select General Indention to apply the default indentation style configured in the general settings.
- If you want the same indention for the SQL main keywords as everywhere just leave the SQL Indention set to „General Indention“.
Large Keyword Size
- But sometimes we want nice alignment for the main SQL tokens. They should be aligned with the main keywords. In the SQL below the largest keyword is „left outer join“ and therefore all tokens are aligned to „left outer join„.
- The indention for case keywords is still the size mentioned in „General Indention“.
Small Keyword Size
- If „Large Keyword Size“ does not fit to your need you can choose „Small Keyword Size“. SQLinForm will look to all the main keywords:
select, from, left outer join, where, order by, group by
and take the size of the largest first word of the keywords to determine the indention size which is in this example the size of „select“ keyword. „select“ is larger than from, left, where, order, group
The indention for case keywords is still the size mentioned in „General Indention“.
Align Master Keywords
- Justify Right SQL Keywords
- Aligns SQL master keywords (e.g.,
SELECT
,FROM
,WHERE
) to the right for a unique formatting style. - This option is commonly used in certain SQL formatting standards to emphasize keywords.
- Aligns SQL master keywords (e.g.,
Align According to Axis River Concept
Set Options for Axis River Concept
- Enables formatting options that adhere to the Axis River Concept, a specialized SQL formatting approach focused on visual structure and alignment.
- This concept emphasizes the alignment and spacing of SQL keywords and clauses to create a „river-like“ flow in the script.
Details of Axis River Concept Formatting:
- Justify-Right Keywords: Aligns master SQL keywords to the right for better visual separation.
- Alignment: Applies larger keyword sizes for easier identification of key clauses.
- No Indent for Specific Clauses: Removes indentation for logical operators (
AND/OR
) inWHERE
,ON
, andHAVING
clauses. - Line Break Rules: Adds line breaks before but not after certain keywords (
FROM
,WHERE
,HAVING
,GROUP BY
,ORDER BY
,JOIN
,ON
).
Save Profile Before Activation
- Save the current profile before enabling the Axis River Concept to preserve your existing formatting settings.
How to Use These Settings
Set Indentation Preferences
- Choose the General Indention option to apply the standard indentation style configured in the general settings.
Enable Keyword Alignment
- Check Justify Right SQL Keywords to align master keywords to the right for a visually distinct formatting style.
Activate Axis River Concept
- Click Set Options for Axis River Concept to enable specialized formatting.
- Ensure you save your current profile before activation using the Profile > Save Profile option.
Customize Axis River Concept Settings
- Review and apply the specific settings outlined under the concept, such as line break rules and no-indentation clauses.
Tips for Optimal Usage
- Use Justify Right SQL Keywords to adopt a unique formatting style for SQL master keywords.
- Enable the Axis River Concept for complex scripts where visual alignment enhances readability and debugging.
- Save your current profile before activating the Axis River Concept to preserve your original formatting preferences.
- Test the Axis River Concept settings on a sample script to understand its impact on the layout and adjust as needed.
By leveraging these options, you can create SQL scripts that are both structured and visually appealing, tailored to your specific formatting needs. For further assistance, refer to the user manual or contact support.