In IntelliJ IDEs, it is possible to statically analyze SQL queries of multiple dialects (PostgreSQL, MSSQL, SnowSQL). While this is useful during development, having these steps in the CI/CD pipeline ensures that the issues are resolved in the pushed code and that queries written by developers not using the IntelliJ based IDE's are also validated.

I have tagged the question with sql, postgresql and python but the question is more generic than this. The specific case that I'm dealing with however contains python code containing inline PostgreSQL statements.

An example CI job would look like:

  1. Generate DDL based on database(s)
  2. Extract SQL statements from code (using regex or python specific naming conventions)
  3. Validate the table names, column names, sql query etc

I have search for 'SQL Validation', 'SQL Query Validation', 'SQL Static Analysis', 'DDL query validation' but cannot find a tool which would use DDL to validate SQL queries the same way as the IntelliJ does. What tools can do static analysis of SQL code using DDL like IntelliJ IDEs?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.