-
Notifications
You must be signed in to change notification settings - Fork 412
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
[FORMATTING] when set Indentation style to "Tabular, Right", it doesn't format "case when" well. #401
Comments
Sorry for not responding earlier. It seems like you're using incorrect CASE expression syntax. Although you mention "when" inside the title, you don't use that keyword in the example code. At least according to SQL standard, CASE expression syntax should be one of the following:
I'm wondering whether you're perhaps using some SQL dialect that supports CASE-expressions without WHEN-keywords. Anyway, the problem definitely is there, as even with WHEN-keywords the indentation is pretty bad: select x,
case
x
when 1 then 'a'
else 'none'
end a
from tbl; A good result would probably be something like: select x,
case x
when 1 then 'a'
else 'none'
end a
from tbl; or select x,
case x
when 1 then 'a'
else 'none'
end a
from tbl; Not sure. I don't really have a well-formed opinion of how these tabular formatting styles should really ideally look. |
Hi, Oracle database have two case syntax: Here is a demo, |
Yep. I do understand the problem. (Thanks for also mentioning the SQL flavor you're using.) It's just that I'm not really sure what the ideal solution would be. |
Hi, |
The formatting has now been improved in 10.8.0-beta.1 |
Standard style for "case when" is correct, but "Tabular Right" get incorrect format.
I tested it on demo site.
Actual Output
The text was updated successfully, but these errors were encountered: