# SQLTy vs SQLFluff

Both lint SQL. [SQLFluff](<https://github.com/sqlfluff/sqlfluff>) is the standard SQL style linter and formatter: a Python tool with dozens of dialects, templating for Jinja and dbt, and no knowledge of your schema. SQLTy is a type checker: it knows your tables and checks the SQL inside Python strings against them. SQLTy's `sqlty format` and `sqruff` rule use sqruff, a Rust port of SQLFluff's rules.

## Quick comparison

|  | SQLFluff 4.5 | SQLTy 0.10 |
| --- | --- | --- |
| Checks | Style: aliasing, layout, capitalization, some structure | Types, nullability, parameters, names, migrations |
| Knows your schema | No | Yes |
| Where SQL lives | `.sql` files, dbt models | Python strings, `.sql` query files |
| Templating | Jinja, dbt, placeholders | Not needed for Python strings |
| Mistakes found in 12 queries (5 planted) | 0, plus 43 style findings | All 5 (1 needs an opt-in rule) |
| 1,008 queries in 84 files, 4 processes | 3.6 s | 0.05 s |
| Files over 20,000 bytes | Skipped by default | Checked |

## Where SQLTy is stronger

- It catches misspelled columns, ungrouped columns, impossible enum filters and fan-out joins, none of which a style linter knows about.
- SQL inside Python code.
- Speed.

## Where SQLFluff is stronger

- Style rules with fixes, and a large configuration surface.
- dbt and Jinja templating, and warehouse dialects.
- The reference that sqruff and others follow.

## Which should you choose?

For dbt and analytics `.sql` files, use SQLFluff. For SQL that an application runs, use SQLTy. For style inside Python strings, turn on SQLTy's `sqruff` rule.

## Common questions

### Can SQLTy check SQL style too?

Yes, inside Python strings: `sqlty format` formats them with sqruff's layout rules, and `[tool.sqlty.rules] sqruff = "warn"` reports sqruff's other core rules.

## Sources

- [SQLFluff](<https://github.com/sqlfluff/sqlfluff>) 4.5.0 (PyPI), `--dialect postgres`
- One schema and 12 queries with 5 planted mistakes, PostgreSQL 16, 4 cores, sqlty 0.9.0 (2026-11-29)
