Intellij Idea不能正确格式化SQL代码
我已经重新安装了Intellij Idea的最后版本,然后当我尝试格式化SQL文件时,它订购了图像所示的所有行。
但是,我尚未在以前的版本中为SQL格式制作任何设置,并且格式是可以的,如我当前的设置预览所示,如下所示:
所以,是否有任何默认值正确格式化SQL?设置中有很多选择,但是我只想在设置上使用默认的选择(我尝试过,但格式几乎相同)。
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.
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:
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).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我面临同样的问题。设置/语言& frameworks/sql方言,您可以在那里找到文件的方言。将其更改为您使用的内容。
这就是我解决问题的方式,即使您应用了全局或项目SQL方言,也可能无法更新文件。
您可以从图像中看到,
generic sql
会导致问题。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.
As you can see from the image,
Generic SQL
causes the problem.对我来说,它可以禁用'line Breaks'在'包装' tab
For me, it works to disable the 'Line breaks' option in the 'Wrapping' tab
PIP安装mySQL连接器(主要工作)
pip install mysql-connector (works mostly)