SQL - disable auto-format on FROM sub-clause Follow
Answered
Let's say I have such code
SELECT * FROM (
SELECT * FROM xxxxxxx
the moment I type closing bracket it formats the code not to my liking.. I can't find the setting to disable this behaviour
Please sign in to leave a comment.
@Dawid Nawrot,
Could you provide a screenshot of your current result and a desired one? Also, it would be handy to get a sample DDL.
What dialect do you use?
This is when I start typing, in order to wrap a query in a outer query
When I type the second parenthesis it will format it to:
But I would like the following:
You need to pay attention to `Subquery` and `Where` formatting options. As for `*`, it's impossible to put it on a separate line for now.
Example settings for PostgreSQL dialect:
Can I disable it completely? I am failing at configuring it to behave like I want. It changes indentation etc. I think it will be easier to completely switch off formatting when I press ")", can I do that?
@Dawid Nawrot,
>I am failing at configuring it to behave like I want
Could you specify SQL Dialect you work with and describe your desired behavior?
> easier to completely switch off formatting when I press ")"
You need to set values to Do not change
Hmm it still didn't work. I set Do not change on PostgreSQL and Generic SQL (just in case).
When I start typing this
And then if I press enter while being inside the parenthesis I get this, with the cursor being at 5 char (not 4, why?)
Whereas I would prefer:
With the cursor being at 4 character, so the regular tab size
@Dawid Nawrot,
Could you specify console dialect you work with?
SQL Code formatter depends from dialect you work with. Did you try Reformate code action?

It shows Amazon Redshift but there is no specific code style settings for Redshift, is there?
>It shows Amazon Redshift but there is no specific code style settings for Redshift, is there?
You should use PostgreSQL code style for Redshift.