DataGrip: How to chop long 'returning' part for PostgreSQL query?

Answered

I have the following problem with formatting a PostgreSQL query in Datagrip (and also in all other JetBrains products regarding PG queries):

update some_table
set some_column = 42
where id = 42
returning val_a as "valA",
          val_b as "valB",
          val_c as "valC",
          val_d as "valD",
          val_e as "valE",
          val_f as "valF",
          val_g as "valG";

When I now use the built-in SQL formatter, DataGrip produces this:

update some_table
set some_column = 42
where id = 42
returning val_a as "valA", val_b as "valB", val_c as "valC", val_d as "valD", val_e as "valE", val_f as "valF", val_g as "valG";

You see what the issue is: All returned values are in one line (it even ignores my max-line-length setting). I tried different settings in my IDE but to no avail. Note that for now, I don't care if the returned vals are indented or aligned or whatever, I just want the query to be "readable".

Looking forward to a solution and thanks in advance!

2 comments
Comment actions Permalink

Hello,

Thanks for noticing it.

I've created a new ticket on our tracker to support it: DBE-16107.

Feel free to follow.

1

Please sign in to leave a comment.