Sql Language Injection Exclusions

The screen shot below contains two examples of the same SQL, one of which the injection causes no error because all of the content of the string is correct SQL and the other has an error before a string formatting identifier, in which the format() function will be expected to be called on the Python string to correctly generate the final form of the sql before it is executed.

I understand why the error occurs as the second string is just clearly not correct SQL.  It would be great if the SQL injection could optional account for format string identifiers, but that is not my question.  I see in other posts that some users are advised to turn off their SQL Injection to avoid these errors.  I very much like the SQL injection and find it very useful. However, in these circumstances, I would like to add an annotation to indicate to PyCharm that this particular error is acceptable and it should ignore just this error.

I love my JetBrains products, but I never quite understand why for most errors identified by the app, I can choose to exclude the error and the app injects some comment that tells the app not to highlight that particular error.  However, I can not figure out how to do that with this Sql Injection error, it appears to be an all or nothing option, which is not particularly helpful or desirable.

Any suggestions?

 

2

Please sign in to leave a comment.