# sql

> SQL files: layout and style in your dialect, and at level all, comments and file length.

SQL files: layout and style in your dialect, and at level all, comments and file length.

## Checks

| Check                                             | Stage    | Level         | What it does                                                                                                                          |
| ------------------------------------------------- | -------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| [`sql/sqlfluff`](/reference/checks/sql/sqlfluff/) | `commit` | `recommended` | Lints every SQL file for layout, capitalization, aliasing, and ambiguous references, in the dialect the database configuration names. |

## Settings

| Setting                                                                   | What it sets                                                                                |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| [`limits.file_lines`](/reference/gspot-toml/#limits.file_lines)           | The most lines one file may have, not counting blank lines and comment-only lines.          |
| [`tools.sqlfluff.dialect`](/reference/gspot-toml/#tools.sqlfluff.dialect) | The SQL dialect that SQLFluff parses, such as postgres. The postgres configuration sets it. |

## Selected when

gspot selects it in a scope with file extensions `.sql`, `.pgsql`, `.psql`. A configuration that requires it selects it too: [`postgres`](/reference/configurations/postgres/).

## Rules for coding agents

| Rule file                                         | Installed when |
| ------------------------------------------------- | -------------- |
| `.gspot/configurations/language/sql/rules/SQL.md` | Always         |

## Tools and versions

| Tool     | Version |
| -------- | ------- |
| sqlfluff | `4.3.0` |

## Files gspot writes

gspot writes `.gspot/configurations/language/sql/sqlfluff.cfg`.
