Search code examples
sqlintellij-ideacode-formatting

Format SQL code: function closed parenthese under the name of function


I'm working on PhpStorm (the same as for any other IDEA product) and there is a possibility to manage SQL auto-formatting in it.

I'm playing with settings to unify our SQL formatting standard. I've stuck with the closed parenthesis of function and couldn't move by the setting of IDEA. The next example is what I have:

SELECT person.id,
       JSONB_BUILD_OBJECT(
               'id', person."PERSON_ID"::TEXT,
               'name', person."PERSON_ID"::TEXT,
           )
...

and what I want is

SELECT person.id,
       JSONB_BUILD_OBJECT(
           'id', person."PERSON_ID"::TEXT,
           'name', person."PERSON_ID"::TEXT,
       )
...

Can somebody advise me something what to do to make it?

I've made changes in all sections already and it couldn't find the necessary setting.


Solution

  • This is a bug, and we have it reported here:

    https://youtrack.jetbrains.com/issue/DBE-17350

    We'll also add a feature to make more adjustments to the indent placement in the expressions:

    https://youtrack.jetbrains.com/issue/DBE-17351