SQL

The Best SQL Static Analysis Tools (Linters/Formatters)

We rank 22 SQL linters, code analyzers, formatters, and more. Find and compare tools like Mega-Linter, Sigrid, DeepSource, and more. Please rate and review tools that you've used. This helps others find the best tools for their projects.

12 SQL Tools

SQLFluff

Multiple dialect SQL linter and formatter.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedcli
  • MaintainedlinterMaintainedformatter
  • 75% upvoted

tsqllint

T-SQL-specific linter.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedcli
  • Maintainedlinter
  • 80% upvoted

dbcritic

dbcritic finds problems in a database schema, such as a missing primary key constraint in a table.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedcli
  • Maintainedlinter
  • 100% upvoted

holistic

More than 1,300 rules to analyze SQL queries. Takes an SQL schema definition and the query source code to generate improvement recommendations. Detects code smells, unused indexes, unused tables, views, materialized views, and more.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedservice
  • Maintainedlinter
  • 100% upvoted

squawk

Linter for PostgreSQL, focused on migrations. Prevents unexpected downtime caused by database migrations and encourages best practices around Postgres schemas and SQL.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedcli
  • Maintainedlinter
  • 100% upvoted

pgspot

Spot vulnerabilities in postgres extension scripts. Finds unsafe search_path usage and unsafe object creation in PostgreSQL extension scripts or any other PostgreSQL SQL code.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedcli
  • Maintainedlinter
  • 0% upvoted

sqlcheck

Automatically identify anti-patterns in SQL queries.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedcli
  • Maintainedlinter
  • 0% upvoted

Visual Expert

Code analysis for PowerBuilder, Oracle, and SQL Server Explores, analyzes, and documents Code

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedservice
  • Maintainedlinter
  • 0% upvoted

WhiteHat Sentinel Dynamic

Part of the WhiteHat Application Security Platform. Dynamic application security scanner that covers the OWASP Top 10.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedcli
  • Maintainedlinter
  • 0% upvoted

sleek

Sleek is a CLI tool for formatting SQL. It helps you maintain a consistent style across your SQL code, enhancing readability and productivity. The heavy lifting is done by the sqlformat crate.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedcli
  • Maintainedformatter
  • 0% upvoted

TSqlRules

TSQL Static Code Analysis Rules for SQL Server.

  • DeprecatedDeprecated
  • DeprecatedSql
  • Deprecatedcli
  • Deprecatedlinter
  • 0% upvoted

sqlint

Simple SQL linter.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedcli
  • Maintainedlinter
  • 0% upvoted

10 Multi-Language Tools

Mega-Linter

Mega-Linter can handle any type of project thanks to its 70+ embedded Linters, its advanced reporting, runnable on any CI system or locally, with assisted installation and configuration, able to apply formatting and fixes

  • MaintainedMaintained
  • MaintainedMulti-Language
  • Maintainedcli
  • Maintainedlinter
  • 67% upvoted

Sigrid

Sigrid helps you to improve your software by measuring your system's code quality, and then compares the results against a benchmark of thousands of industry systems to give you concrete advice on areas where you can improve.

  • MaintainedMaintained
  • MaintainedMulti-Language
  • MaintainedcliMaintainedservice
  • Maintainedlinter
  • 92% upvoted

DeepSource

In-depth static analysis to find issues in verticals of bug risks, security, anti-patterns, performance, documentation and style. Native integrations with GitHub, GitLab and Bitbucket. Less than 5% false positives.

  • MaintainedMaintained
  • MaintainedMulti-Language
  • Maintainedservice
  • Maintainedlinter
  • 68% upvoted

Application Inspector

Commercial Static Code Analysis which generates exploits to verify vulnerabilities.

  • MaintainedMaintained
  • MaintainedMulti-Language
  • Maintainedservice
  • Maintainedlinter
  • 55% upvoted

Atom-Beautify

Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom editor.

  • DeprecatedDeprecated
  • DeprecatedMulti-Language
  • Deprecatedide-plugin
  • Deprecatedlinter
  • 50% upvoted

goone

Finds N+1 queries (SQL calls in a for loop) in go code

  • DeprecatedDeprecated
  • DeprecatedMulti-Language
  • Deprecatedcli
  • Deprecatedlinter
  • 0% upvoted

SafeQL

Validate and auto-generate TypeScript types from raw SQL queries in PostgreSQL. SafeQL is an ESLint plugin for writing SQL queries in a type-safe way.

  • MaintainedMaintained
  • MaintainedMulti-Language
  • Maintainedcli
  • Maintainedlinter
  • 0% upvoted

sqlvet

Performs static analysis on raw SQL queries in your Go code base to surface potential runtime errors. It checks for SQL syntax error, identifies unsafe queries that could potentially lead to SQL injections makes sure column count matches value count in INSERT statements and validates table- and column names.

  • MaintainedMaintained
  • MaintainedMulti-Language
  • Maintainedcli
  • Maintainedlinter
  • 0% upvoted

OpenRewrite

OpenRewrite fixes common static analysis issues reported through Sonar and other tools using a Maven and Gradle plugin or the Moderne CLI.

  • MaintainedMaintained
  • MaintainedMulti-Language
  • Maintainedcli
  • MaintainedlinterMaintainedformatter
  • 0% upvoted

StaticReviewer

Static Reviewer executes code checks according to the most relevant Secure Coding Standards, OWASP, CWE, CVE, CVSS, MISRA, CERT, for 40+ programming languages, using 1000+ built-in validation rules for Security, Deadcode & Best Practices Available a module for Software Composition Analysis (SCA) to find vulnerabilities in open source and third party libraries.

  • MaintainedMaintained
  • MaintainedMulti-Language
  • Maintainedcli
  • Maintainedlinter
  • 36% upvoted

Frequently Asked Questions

What are SQL tools?

There are many programming languages in the world, but SQL is one of the most important ones. It is used to communicate with databases, making it essential for managing and querying data. SQL is easy to learn and use, making it a popular choice for developers.

What are the best SQL static analysis tools and linters?

The most popular SQL tools ranked by user votes are: Mega-Linter, Sigrid, DeepSource, SQLFluff, tsqllint.

Which SQL tools are free to use?

Tools with a free plan include DeepSource. On top of that, there are also a number of open source like Mega-Linter, SQLFluff, tsqllint, dbcritic, squawk, Atom-Beautify, goone, pgspot, SafeQL, sqlcheck.

Related Tags

Our Sponsors

This website is completely open source. To fund our work, we fully rely on sponsors. Thanks to them, we can keep the site free for everybody. Please check out their offers below.

  • BugProve
  • Pixee
  • semgrep
  • Offensive 360
  • BetterScan