在 JetBrains PyCharm 中禁用 SQL 检测 [英] Disable SQL detection in JetBrains PyCharm

查看:51
本文介绍了在 JetBrains PyCharm 中禁用 SQL 检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图输入以下行:

self._label = QtGui.QLabel("Select parameter from selected category")

PyCharm 决定我正在执行 SQL 查询或其他操作,并给出有关未配置数据连接的错误.字符串中的语法突出显示发生了变化,Selectfrom 变得像关键字一样突出显示.因为我根本不使用 SQL 或任何数据库之类的东西(我是一名编程工程师 - 我不使用数据库,抱歉)......我只是在 PyCharm 插件设置中禁用了 SQL 插件.

And PyCharm decided I was doing an SQL Query or something and gave errors about having no data connections configured. The Syntax Highlighting within the string changed and Select and from became highlighted like keywords. Since I don't use SQL or any database whatnot at all (I'm an engineer who programs - I don't use databases, sorry) ... I simply disabled the SQL Plugin in the PyCharm plugin settings.

如果我想要打开该插件,是否有一种不那么激烈的方法来禁用这种自动检查行为?每当它在字符串中看到 Select x from y 时,它都认为这是一个 SQL 查询,这似乎很激烈.我尝试禁用检查设置下的所有 SQL 检查.

Is there a less drastic way to disable this auto-inspection behavior in case I ever wanted that plugin turned on? It seems drastic that any time it sees Select x from y in a string it thinks it's an SQL query. I tried disabling all the SQL inspections under the Inspections settings.

感谢您的帮助.

推荐答案

消息:

没有配置数据源来运行此 SQL 并提供高级代码帮助.`

No data sources are configured to run this SQL and provide advanced code assistance.`

有点明确,恕我直言有点不必要,因为我真的认为我不需要为我们有一些 SQL 查询的每个项目配置一个数据库.

is a little explicit and IMHO a little unnecessary, because I really think that I don't need to configure a database for every project in which we have some SQL queries.

要处理此消息,您有两种选择:

To handle this message, you have two options:

  1. 使用消息上方的 ALT + ENTER 并使用选项配置数据,为您的项目配置数据源来源:
  1. Configure a Data Source to your project, using the ALT + ENTER above the message and using the option Configure a Data Source:

  1. 在 IDE 设置的检查选项中禁用此 SQL 方言检测检查:

第二个选项对我来说是最好的方法,除非我们真的想要或需要您的项目的数据源.

The second option is the best approach for me unless we really want or need a Data Source on your project.

这篇关于在 JetBrains PyCharm 中禁用 SQL 检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆