Allow queries to have columns all on the same line or on different lines

Answered

Basically, I wish to modify my MySQL code style such that the following two queries would be acceptable:

SELECT first_name, last_name, birth_sex FROM owner
SELECT
first_name,
last_name,
birth_sex
FROM
owner

However, while it seems that DataGrip will allow the former format, I am unsure how to modify the format settings such that the second is permitted. Instead, DataGrip formats the second query as follows:

SELECT first_name,
last_name,
birth_sex
FROM owner
2 comments
Comment actions Permalink

You need to set  parameter 'Place elements' to 'New line' in File | Settings | Editor | Code Style | SQL | MySQL -> Queries tab to make it happen.

1
Comment actions Permalink

Yup. That did it. Thank you very much, Yuriy!

I am surprised that "Do not change" changes the format to the following, though, considering the wording:

SELECT first_name,
last_name,
birth_sex
FROM owner
0

Please sign in to leave a comment.