Keep VALUES and RETURNING clause from indenting for INSERT

How the heck can I keep the VALUES and RETURNING from indenting.

My SQL is in a .ts file wrapped in a templated string.

I've been playing around with the SQL formatting in JetBrains preferences but can't seem to get rid of this indenting.

Originally I have for example in one of my CTEs:

`
newJob AS (
INSERT INTO job (country_id)
VALUES (${job.countryId})
RETURNING job_id, country_id
),
`
And when I save the SQL formatting is indenting it like this, which I hate as it's for some reason indenting VALUES and RETURNING:
`
 newJob AS (
     INSERT INTO job (country_id)
         VALUES (${job.countryId})
         RETURNING job_id, country_id),
`

 

0
1 comment

What SQL dialect is it? Did you inject any specific dialect into this SQL fragment using quick actions (yellow lightbulb)?

Does it make a difference if you restore the SQL code style settings to defaults?

As a workaround, you can explicitly disable formatting for injected content:

0

Please sign in to leave a comment.