You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to propose a feature that allows users to configure the indentation for SQL JOIN clauses through an option.
This feature would enable more flexibility in formatting SQL queries to match different coding styles and preferences.
Specifically, I'm looking for the ability to format JOIN clauses like the following example:
SELECT
logs.*,
master.status
FROM
logs
LEFT OUTER JOIN
master
ON
logs.id = master.id
This formatting style increases readability by clearly separating each part of the JOIN clause with consistent indentation.
It would be great to have an option in the SQL Formatter that allows us to achieve this level of clarity in our SQL code.
Thank you for considering this feature request.
The text was updated successfully, but these errors were encountered:
The indentation of the FROM-clause has probably the most variations in the already pretty tricky world of SQL code indentation.
is each join indented to the same level as FROM or one level deeper?
is the ON placed on a separate line?
is ON indented the same amount as the join or deeper?
do you indent the name of the joined table?
do you indent the condition after ON?
It's hard to please everyone. I would need to add several configuration options to cover all the possible styles.
Also, I'm not really doing active feature development on SQL Formatter any more. Instead concentrating on prettier-plugin-sql-cst. But that one also doesn't indent the FROM clause the way you would like and the goal of it is really to be pretty opinionated in its formatting style.
Thank you for your reply. I understand that my proposal may not be easily implemented. I will consider what additional settings might make these variations possible.
I was not aware of prettier-plugin-sql-cst. Thank you for the information. I plan to try it out and see what it can do.
I would like to propose a feature that allows users to configure the indentation for SQL JOIN clauses through an option.
This feature would enable more flexibility in formatting SQL queries to match different coding styles and preferences.
Specifically, I'm looking for the ability to format JOIN clauses like the following example:
This formatting style increases readability by clearly separating each part of the JOIN clause with consistent indentation.
It would be great to have an option in the SQL Formatter that allows us to achieve this level of clarity in our SQL code.
Thank you for considering this feature request.
The text was updated successfully, but these errors were encountered: