pypi sqlfluff 4.6.0
[4.6.0] - 2026-12-03

one hour ago

Highlights

This minor release introduces experimental dbt v2 support, speeds up linting on large projects, and adds two opt-in rules, alongside a broad set of dialect improvements and bug fixes.

  • dbt v2 projects can now try SQLFluff through the new sqlfluff-templater-dbt2 plugin. It uses render traces from dbt’s Rust renderer to map lint findings and fixes back to the original Jinja SQL. The integration is experimental and has been tested against dbt nightly 2.1.0.dev20261202. The Jinja templater also gains the fromyaml and toyaml dbt helpers.
  • Linting does less repeated work. SQLFluff shares parse-tree walks between rules, reuses rule packs across files with the same configuration, and speeds up whitespace fixes on large queries. Parallel Jinja runs can also reuse workers across files and lint runs.
  • The Rust engine can now drive rendering and parsing. The experimental use_rust_engine setting lets Rust handle file discovery, templating dispatch, lexing and parsing. There is also a standalone sqlfluff-rs CLI for render, lex and parse.
  • Two new rules offer additional opt-in conventions. BQ01 lets BigQuery projects forbid WITH expressions. TQ05 can require BEGIN and END around T-SQL IF, ELSE and WHILE bodies, with an autofix.
  • INI configuration and .sqlfluffignore files are now read as UTF-8. This fixes problems with non-ASCII paths on Windows. If you have configuration or ignore files saved in a legacy encoding, resave them as UTF-8 before upgrading.

Beyond that, PostgreSQL gains JSON_TABLE and event triggers, Snowflake gains notebook and compute pool statements, DuckDB gains ATTACH and DETACH and recursive CTEs with USING KEY, and Flink gains INSERT OVERWRITE and CREATE TABLE AS. Autofix changes keep ST07 from rewriting joins where it would change the query results, and prevent edits to Jinja loop bodies when only some iterations need the fix. LT02 now indents INSERT targets and VALUES rows one level deeper.

This release also includes first-time contributions from fifty-nine new contributors.
Thank you all for your contributions. 🏆

What’s Changed

Don't miss a new sqlfluff release

NewReleases is sending notifications on new releases.