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
that's of course a great idea, but also a rather complex one… So, for "expectation management", please don't expect this too be implemented too soon (at least not by me); but it is definitely on the wish list!
Any update on this? Is it still planned or in-progress?
I definitely understand the complexity here. Have we considered a thin-slicing approach rather than tackling it all at once? For example, an MVP could be simply formatting with consistent indentation. Then later options for formatting the field list, aligning conditions, etc.
thanks a lot for opening this issue and for your patience! From the SELECT statements that I saw, there were just too many coding styles to fit all required options into one cleanup rule, so I actually created three of them:
Align SELECT clauses aligns the keywords SELECT, FROM, FIELDS, WHERE, GROUP BY etc. in (main- or sub-)query clauses (but doesn't care for anything after the keywords), e.g.
Align SELECT ... FROM ... JOIN aligns the FROM clause, including joins (don't worry, the cascade-style layout in the example of course not the only layout possible…), e.g.
Align SELECT lists aligns the field lists after SELECT, FIELDS, ORDER BY, GROUP BY, and INTO ( ... ), allowing for both multi-line or single-line layout (or deriving that from the majority of elements in the list):
Align logical expressions was enhanced to also align conditions after JOIN … ON, WHERE, HAVING, and CASE … WHEN:
And yes, you can configure the results ;-)
Align SELECT clauses:
Align SELECT ... FROM ... JOIN:
Align SELECT lists:
Align logical expressions:
Hope this works for you!
Kind regards,
Jörg-Michael
Reacted by ConjuringCoffee, Christian Günter and Fabian Lupa
Activity
jmgrassau commentedon May 21, 2023
Hi Christian,
that's of course a great idea, but also a rather complex one… So, for "expectation management", please don't expect this too be implemented too soon (at least not by me); but it is definitely on the wish list!
Kind regards,
Jörg-Michael
jelliottp commentedon Nov 20, 2023
Any update on this? Is it still planned or in-progress?
I definitely understand the complexity here. Have we considered a thin-slicing approach rather than tackling it all at once? For example, an MVP could be simply formatting with consistent indentation. Then later options for formatting the field list, aligning conditions, etc.
add new rules "Align SELECT clauses/JOIN/lists" (SAP#6)
add new rules "Align SELECT clauses/JOIN/lists" (#6)
jmgrassau commentedon Nov 27, 2023
Hi Christian,
thanks a lot for opening this issue and for your patience! From the SELECT statements that I saw, there were just too many coding styles to fit all required options into one cleanup rule, so I actually created three of them:
And yes, you can configure the results ;-)
Hope this works for you!
Kind regards,
Jörg-Michael
ConjuringCoffee commentedon Nov 27, 2023
Awesome! Looks great so far 👍
christianguenter2 commentedon Nov 27, 2023
Thx a lot. I'll give a try 👍
kaisicker commentedon Nov 27, 2023
Thanks a lot!