Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One column per line for GROUP BY clauses #10

Closed
dogan-sky opened this issue Dec 30, 2021 · 2 comments · Fixed by #14
Closed

One column per line for GROUP BY clauses #10

dogan-sky opened this issue Dec 30, 2021 · 2 comments · Fixed by #14

Comments

@dogan-sky
Copy link

Hi @Matts966 !

Thank you so much for the previous change on formatting rules for WHERE and ON (issue #6).

That change has also introduced new formatting for GROUP BY clauses. All GROUP BY columns seem to be on a single line.

Is it possible to revert the GROUP BY formatting so that there is one column per line, like the example below ?

よろしくお願いします。

SELECT
  *
FROM
  foo.bar_tab1
LEFT JOIN
  foo.bar_tab2
ON
  foo.bar_tab1.id = foo.bar_tab2.id
WHERE
  col1 = 'abc'
  AND col2 > 10
  AND col3 IS NOT NULL
GROUP BY
  1, 
  x, 
  y, 
  z;
@Matts966
Copy link
Owner

Matts966 commented Jan 4, 2022

Hi! Thank you for your conrtibution!

@dogan-sky
How about automatically sorting columns and formatting column words per line, column numbers in a line.

from

SELECT
  *
GROUP BY
  x, y, z, 1, 2;

to

SELECT
  *
GROUP BY
  1, 2, 
  x,
  y,
  z;

@dogan-sky
Copy link
Author

That sounds good, thanks @Matts966 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants