Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA cannot format SQL code properly

I have reinstalled the last version of IntelliJ IDEA and then when I try to format an SQL file, it orders all the lines as shown on the image.

My SQL file

However, I have not made any settings for SQL formatting in the previous versions and the format was OK as shown on my current setting preview as shown below:

My current settings

So, is there anything default to format SQL properly? There are lots of choices in the settings, but I just want to use a default one available on the settings (I tried but it format almost the same).


1 Answers

I faced the same issue. Settings/Languages&Frameworks/SQL Dialects, there you can find the dialect of the file. Change it to what you use.

That's how I solved the problem, even though you apply global or project SQL Dialect, the file may not be updated.

enter image description here

As you can see from the image, Generic SQL causes the problem.

like image 147
Esen Mehmet Avatar answered Sep 11 '26 18:09

Esen Mehmet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!