skillfed

sqlfluff-templater-dbt

Lint your dbt project SQL

sqlfluff-templater-dbt v4.3.0 3.7M downloads/30d#2,518 on PyPI9,853
Permissive license MIT License Copyright (c) 2018-2026 Alan Cruickshank Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) Active released

What it is and what it does

sqlfluff-templater-dbt is a plugin that extends SQLFluff's linting capabilities to work with dbt projects. It allows SQLFluff to parse and lint dbt template syntax—Jinja2 expressions, dbt macros, and ref() calls—by rendering them through dbt's templating engine before analysis. This bridges the gap between dbt's SQL generation and SQLFluff's dialect-aware linting, letting you enforce SQL style and correctness rules across your entire dbt project.

The plugin is designed for teams using dbt for ELT workflows who want to maintain consistent SQL quality and formatting standards. It integrates dbt-core and jinja2-simple-tags to handle template resolution, then applies SQLFluff's linting rules to the rendered output. You can use it to auto-fix formatting issues, catch SQL errors, and enforce organizational style guides on dbt-generated SQL.

Use it for:

  • Enforce SQL formatting and style standards across a dbt project's models and tests.
  • Auto-fix spacing, indentation, and syntax issues in dbt SQL before deployment.
  • Catch SQL dialect-specific errors in dbt models targeting Snowflake, BigQuery, or other databases.
  • Integrate dbt SQL linting into CI/CD pipelines to gate model deployments on code quality.
  • Validate dbt macros and templated SQL for consistency across teams.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Enables SQLFluff to lint and auto-fix dbt project SQL using dbt templating, integrating dbt-core and Jinja2 template processing into SQLFluff's multi-dialect SQL linting workflow.

Yes, if you use dbt and want to lint your project's SQL. The plugin is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and integrates cleanly with SQLFluff's existing multi-dialect support. Install it when you need to enforce SQL quality standards on dbt-generated code.

Install

sqlfluff-templater-dbt on PyPI

pip

pip install sqlfluff-templater-dbt

uv

uv add sqlfluff-templater-dbt

poetry

poetry add sqlfluff-templater-dbt

Installing sqlfluff-templater-dbt

Before you install

Low install friction with a pure-Python wheel. Actively maintained with a release 7 days ago and 9853 GitHub stars. Requires sqlfluff, dbt-core, and jinja2-simple-tags as runtime dependencies.

License in practice

MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike.

Quickstart

pip install sqlfluff-templater-dbt

from sqlfluff.core import Linter

linter = Linter(dialect='snowflake', templater='dbt')
result = linter.lint_string('SELECT * FROM {{ ref("my_model") }}')

Requires dbt-core to be installed and a valid dbt project structure with dbt_project.yml present for template resolution.

Verify before relying

  • Specific dbt versions or configurations required for full compatibility with this templater plugin.
  • Whether the templater supports all dbt features (macros, packages, custom tests) or has known limitations.
  • Performance characteristics when linting large dbt projects with many models and dependencies.

Package facts

License MIT License Copyright (c) 2018-2026 Alan Cruickshank Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 3 — sqlfluff, dbt-core, jinja2-simple-tags
Maintenance actively maintained — 7 days since the last release
Last repo commit
First released
Downloads 3,717,769/month — #2,518 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sqlfluff_templater_dbt-4.3.0-py3-none-any.whl

Keywords: sqlfluff, sql, linter, formatter, bigquery, clickhouse, databricks, db2, duckdb, exasol, greenplum, hive, materialize, mysql, postgres, redshift, snowflake, soql, sparksql, sqlite, teradata, tsql, dbt

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Quality AssuranceTopic :: Utilities

Tags

dbt sql lintingsqlfluff dbt templatinglint dbt project sqldbt template sql formatterdbt sql quality checkssqlfluff dbt integrationdbt sql style enforcement
dbt-integrationsql-lintingdata-engineering

More Utilities packages