Does anyone know how I turn off the SQL validation in Intellij IDEA 9?
We often have more than one connection to a different type of database within one class. IntelliJ only allows one SQL dialect per class, resulting in what IntelliJ thinks are errors, so litters my code with red lines.
Ideally I'd just like to turn the errors off completely, as they are distracting and not actually real errors.
Settings > Inspections. Unselect 'SQL'. Alternatively you can place your cursor on the error and press alt+enter. One of the options will be 'Disable Inspection'.
You could use a comment language= before the statement, i.E.
//language=MySQL
String stmt1 = "INSERT INTO a (b) values(?)";
//language=Oracle
String stmt2 = "SELECT SYSDATE FROM dual";
See https://www.jetbrains.com/idea/help/using-language-injections.html
You can alternatively turn off the specific inspection that is bothering you. No need to turn off all SQL support (e.g. auto-complete hints are nice).
To do this, you can go to Settings --> Editor --> Inspections --> SQL and uncheck the ones you don't want. For instance, I just disabled "No data sources configured" and "Unresolved reference".
In IntelliJ Ultimate 2019.2, this looks like this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With