Scan SQL scripts inside JS files

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    • Developer edition, version 9.0.1
  • what are you trying to achieve
    • Scan SQL scripts in JS files
    • Our JS files need to run knex scripts to make updates in our SQL databases, and such updates were written in SQL
    • We would like to know whether (and how) SonarQube can scan SQL scripts inside “.js” files please
  • what have you tried so far to achieve this
    • added “sql” as suffix to PL/SQL and “.sql” to “T-SQL” but no luck

Thank you


In general, cross-language analysis within files is very much the exception rather than the rule. And it’s simply not available for SQL inside of .js files.