What’s Changed
This release brings about several great new additions including:
- dbt 1.0.0 compatibility.
- CLI and Simple API paramaters to provide custom paths to config files.
- Refinement to Simple API to return parse output in JSON format rather than as an internal SQLFluff object (BREAKING CHANGE).
- An Official SQLFluff Docker Image.
- Grammar improvements across various dialects.
- A new rule (L057) to check for non-alphanumeric values in identifiers.
There have also been many bug fixes and improvements to the CI and development processes.
🚀 Enhancements
- TSQL: Reserved Keyword cleanup #2100 @jpers36
- Add wiki links to CONTRIBUTING.md #2106 @tunetheweb
- Add snowflake create stage and alter stage statements + RegexParser case fix #2098 @chwiese
- Allow for more value types in ALTER TABLE ALTER COLUMN SET DEFAULT statement #2101 @derickl
- Grammar: Adds support for ALTER VIEW statement for Postgres dialect #2096 @derickl
- Add example for using JSON output of Simple API parse function #2099 @jpy-git
- Allow optional keywords in create table unique constraints #2077 @kayman-mk
- Grammar: Adds support for ALTER FUNCTION statement for Postgres dialect #2090 @derickl
- Grammar: adds support for CREATE/ALTER/DROP DATABASE for Postgres dialect #2081 @derickl
- Update parse method of Simple API to output JSON parse tree #2082 @jpy-git
- TSQL dialect: add parsing for MERGE statement #2057 @tkachenkomaria244
- Simple API config path #2080 @jpy-git
- dbt 1.0.0 compatability #2079 @alanmcruickshank
- Parse
on deleteandon updateclause for create table constraints #2076 @kayman-mk - Pre-commit: Add hook for doc8 #2074 @jpy-git
- Grammar: Fix typo in Alter Table parser in Postgres dialect #2072 @derickl
- Grammar: Adds support for materialized views for postgres dialect #2041 @derickl
- Add basic pre-commit config #2067 @jpy-git
- CLI: Add --ignore-local-config flag #2061 @jpy-git
- TSQL: INSERT INTO #2054 @jpers36
- Add --disable-noqa option to CLI and config #2043 @jpy-git
- TSQL: TRY/CATCH #2044 @jpers36
- enabled arrays support in
declareandsetstatements forbigquerydialect #2038 @KulykDmytro - L008 refactor #2004 @jpy-git
- Support init.py for library_path #1976 @Tonkonozhenko
- L052: Redefine semi-colon newline to multiline newline #2022 @jpy-git
- Grammar: Remove hash inline comment from Postgres #2035 @jpy-git
noqaenhancement: Enable glob rule matching for inline comments #2002 @jpy-git- TSQL (ASA): Allow for table identifier in DELETE clause #2031 @jpers36
- TSQL (ASA): Fix CTAS with WITH statement #2028 @jpers36
- Grammar: Parse multiple grants #2023 @jpy-git
- Add tsql nested block comment support and add regex package dependency #2027 @jpy-git
- Grammar: Add complete Snowflake datetime units #2026 @jpy-git
- Grammar: Add DROP POLICY statement to postgres dialect #2024 @jpy-git
- Grammar: Add complete datetime units to postgres dialect #2025 @jpy-git
- Grammar: Postgres CREATE POLICY #2021 @jpy-git
- Speed up CI #1957 @pwildenhain
- Add support for Snowflake create/alter SQL and js UDF #1993 @chwiese
- Add encoding CLI argument #1994 @jpy-git
- TSQL: Spaces allowed in comparison operators #1965 @jpers36
- Add Snowflake schema options #1950 @chwiese
- CLI/
.sqlfluffenhancement: Rule globs #1972 @jpy-git - Add config CLI argument to lint, fix, and parse #1986 @jpy-git
- Add type hints to simple API #1951 @jpy-git
- New rule to flag special characters in identifiers #1958 @jpers36
- Allow column references in IN statement #1971 @tunetheweb
- Remove config.ini in favor of setup.cfg #1966 @jpy-git
- Convert sqlfluff-templater-dbt setup.py to setup.cfg #1963 @jpy-git
- Official Docker image: Dockerfile and Github Actions workflow #1945 @jpy-git
- Move package metadata to setup.cfg #1960 @jpy-git
🐛 Bug Fixes
- Fix tsql block comment close #2095 @jpy-git
- Fix PlaceholderTemplater slice_type for templated code (substitutions) #2085 @barrywhart
- Exasol: Fix UDF script syntax #2083 @sti0
- Fix issues with placeholder templating docs #2078 @jpy-git
- Update dbt templater docs to clarify that the profiles_dir setting is optional #2070 @barrywhart
- Bug fix of L054 for Snowflake and Exasol #2069 @tunetheweb
- Fix L043 issue when trying to autofix functions #2059 @jpy-git
- Add request for users dbt version in bug_report issue template #2058 @jpy-git
- Fix parameters for Snowflake create tasks statement #2037 @chwiese
- Linguist: Include test/** in language statistics to better reflect use of SQL #2034 @jpy-git
- L044 should handle nested CTEs #1991 @barrywhart
- Add dbt adapter install advice to configuration documentation #2011 @jpy-git
- Update pre-commit dbt instructions to reference separate dbt package #2005 @jpy-git
- Fix config.get for iterable sections #2020 @jpy-git
- Fix inline comment interactions with L052 #2019 @jpy-git
- Make Snowflake tags DRY #1992 @chwiese
- Rename whitelist/blacklist to allowlist/denylist #1989 @jpy-git
- Fix issue with inline ignores not respecting comment lines #1985 @jpy-git
- Fix L009 FileSegment child + new create_before/create_after edit types #1979 @jpy-git
- Adds extra check to L054 to avoid weird error messages #1988 @tunetheweb
- BigQuery: Allow keywords in column reference components #1987 @tunetheweb
- L027: Remove unnessary crawl in get_select_statement_info #1974 @jpy-git
- Add all attributes to init.py files to resolve F401 #1949 @jpy-git
- Fix incorrect comment on L055 #1967 @jpy-git
- Docs: fix docker hub link to public URL #1964 @kevinmarsh
- Fix issue releasing dbt package: tox commands run relative to repo root #1962 @jpy-git