SQL

The Best SQL Static Analysis Tools (Linters/Formatters)

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

12 SQL Tools

17

SQLFluff

Multiple dialect SQL linter and formatter.

  • MaintainedMaintained
  • MaintainedSql
  • Maintainedcli
  • MaintainedlinterMaintainedformatter
  • 77% upvoted
2

tsqllint

T-SQL-specific linter.

  • DeprecatedDeprecated
  • DeprecatedSql
  • Deprecatedcli
  • Deprecatedlinter
  • 63% upvoted
1

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
  • 67% upvoted
0

dbcritic

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

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

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
0

sqlcheck

Automatically identify anti-patterns in SQL queries.

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

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
  • 50% upvoted
0

Visual Expert

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

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

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
-1

TSqlRules

TSQL Static Code Analysis Rules for SQL Server.

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

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
-2

sqlint

Simple SQL linter.

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

12 Multi-Language Tools

139

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
22

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
  • 89% upvoted
16

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
  • 69% upvoted
1

Application Inspector

Commercial Static Code Analysis which generates exploits to verify vulnerabilities.

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

diesel-guard

Linter for dangerous Postgres migration patterns in Diesel and SQLx. Prevents downtime caused by unsafe schema changes.

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

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
0

BlockWatch

A language-agnostic linter that keeps code, documentation, and configuration in sync and enforces strict formatting and validation rules.

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

goone

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

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

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
0

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
-2

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
  • 25% upvoted
-3

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, SQLFluff, DeepSource, 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, diesel-guard, Atom-Beautify, BlockWatch, dbcritic, goone, pgspot, SafeQL.

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