Datagrip SQL Code Formatting: JOIN / ON / AND Indention

I would like the `and` in the join below to indent in alignment with `on`, but cannot locate the appropriate setting. Any suggestions?

Expected

left join b
  on b.id = a.id
  and b.line_id = a.line_id

Actual

left join b
  on b.id = a.id
and b.line_id = a.line_id
0
3 comments

You need to play around with the following setting in File | Settings | Editor | Code Style | SQL | General:

0

I already have that set to `JOIN continuously indented`. The `on` is indented correctly, but the `and` is not. 

If I change to `JOIN indented`, as you have, the `on` is no longer indented. It looks like the following.

left join b
on b.id = a.id
and b.line_id = a.line_id

 

Settings:

0

There is no option to indent the AND clause I'm afraid, but you can achieve the desired result using the following settings:

0

Please sign in to leave a comment.