Skip to content
Advertisement

Disable SQL detection in JetBrains PyCharm

I was trying to type the following line:

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

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.

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.

Thanks for any help.

Advertisement

Answer

The message:

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

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. Configure a Data Source to your project, using the ALT + ENTER above the message and using the option Configure a Data Source: Add a data source

or

  1. Disable this SQL dialect detection inspection on the Inspection options on the IDE settings:

Disable the SQL dialect detection

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

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement