Co-authored-by: alanmcruickshank <alanmcruickshank@users.noreply.github.com> Co-authored-by: Alan Cruickshank <alan+git@designingoverload.com>
551 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[3.2.5] - 2024-10-25
Highlights
This release is mostly bugfixes and dialect improvements. Notably:
- Whitespace handling improvements to
LT01<02. - Better error messages around trying to iterate on missing jinja variables.
- Better case sensitivity for
AL09. - Improved handling of jinja context in inline config directives.
- Enabling
AM02for Trino and Snowflake. - Handling potential collisions between
ST02<01. - Preventing false positives in AL05 with arrays.
There's also a bunch of documentation improvements in this release, including guides on how to troubleshoot SQLFluff and how to write custom rules. Check out https://docs.sqlfluff.com for more details.
We also saw five new contributors to the project this month. Welcome to the project, and thanks for taking the time to contribute! 🎉🏆🎉
What’s Changed
- Guides for custom rules and for troubleshooting #6379 @alanmcruickshank
- Documentation and small overhaul of parametrized rule test cases #6380 @alanmcruickshank
- TSQL: add missing unreserved keyword NULLS (#5212) #6390 @simonhoerdumbonde
- Introducing SQLFluff Guru on Gurubase.io #6373 @kursataktas
- Improve heuristics for inline config #6391 @rogalski
- Postgres: Handle expressions that occur in
INfunctions #6393 @keraion - Snowflake: Support bracketed lambda functions without datatypes #6394 @keraion
- LT01: Add default config for
match_conditionto touch #6395 @keraion - Snowflake: Allow for additional
CONNECT BYexpressions that may usePRIOR#6396 @keraion - Details on debugging and setup for diff-quality #6381 @alanmcruickshank
- Fix edge case in Jinja reindents #6383 @rogalski
- Support identifier clause for Databricks #6377 @PaulBurridge
- Enable AM02 for snowflake and trino by default. #6369 @mchen-codaio
- Postgres: Support identifiers in
ALTER DATABASE SET#6376 @keraion - SparkSQL: Improved lexing and parsing of file literals #6375 @keraion
- Fix Snowflake alter share #6372 @greg-finley
- Resolve collision between ST02 and LT01 #6366 @alanmcruickshank
- Prevent false positives with AL05 and array functions #6365 @alanmcruickshank
- Handle iteration and getting undefined jinja variables #6364 @alanmcruickshank
- Update documentation with new dialects #6337 @mchen-codaio
- enable default values when creating databricks tables #6362 @VictorAtIfInsurance
- Postgres : Add
ALTER AGGREGATEStatement #6353 @R3gardless - Revise AL09 (self aliasing) - stricter case sensitivity #6333 @alanmcruickshank
- Make dbt
RelationEmulatorsafely callable #6358 @mroy-seedbox
New Contributors
- @VictorAtIfInsurance made their first contribution in #6362
- @mchen-codaio made their first contribution in #6337
- @PaulBurridge made their first contribution in #6377
- @kursataktas made their first contribution in #6373
- @simonhoerdumbonde made their first contribution in #6390
[3.2.4] - 2024-10-14
Highlights
This release is almost all dialect fixes and bugfixes. Notably also, this release brings official python 3.13 support too (although most users should not realise any differences).
We also saw two new contributors to the project. Welcome @R3gardless & @brandonschabell! 🎉🎉🎉
What’s Changed
- Utilize a deepcopy of the config object when parsing files #6344 @brandonschabell
- Snowflake supports other literals in system functions #6355 @alanmcruickshank
- Snowflake: Un-reserve CURRENT_USER #6354 @alanmcruickshank
- tsql: handle additional primary/foreign key options in constraints #6347 @keraion
- Add
DROP COLUMNsupport for multiple dialects #6348 @keraion - TSQL: allow
UPDATEto be a function name #6349 @keraion - tsql: allow both on delete and on update in a
reference_constraint#6346 @keraion - Postgres : Allow Extensions with Special Characters in Name #6345 @R3gardless
- Fix
toxcommand in test/fixtures/dialects/README.md #6342 @R3gardless - Revise dbt warnings when a file fails to compile #6338 @alanmcruickshank
- Postgres: Add
CREATE FOREIGN DATA WRAPPERstatement #6335 @keraion - Trino: Add some support to
json_queryfunctions #6336 @keraion - Handle deprecation warning of "fork" #6332 @alanmcruickshank
- Python 3.13 support and make it default for test coverage #6269 @alanmcruickshank
- ST06 - Fix union of CTE/Subquery #6298 @rogalski
- Refactor timestamp grammar #6331 @greg-finley
New Contributors
- @R3gardless made their first contribution in #6342
- @brandonschabell made their first contribution in #6344
[3.2.3] - 2024-10-10
Highlights
This is another release of dialect improvements and rule bugfixes. Notably:
- More robust algorithms for the indentation of Jinja template tags in
LT02. - The
github-annotation-nativeformat option now has groups for each filename.
There's also a refactor of where we guides and howtos in the docs. Keep an eye on that section going forward for more information about best practice and troubleshooting for SQLFluff.
Even in this small PR, we've seen two new contributors. Welcome @nspcc-cm & @rogalski to the project!
What’s Changed
- BigQuery: Support Tuple syntax in other locations #6328 @keraion
- Trino: Fix rule interactions with lambda functions #6327 @keraion
- Resolve some more edge cases in LT02 #6324 @alanmcruickshank
- RF05 - fine tuning for snowflake dialect #6297 @rogalski
- Indentation:
UPDATEandRETURNINGclauses #6314 @keraion - Postgres: Fix lexing some JSON operators #6323 @keraion
- Add support for
grant monitor on user ...in Snowflake dialect #6322 @mroy-seedbox - Exclude templated casts from CV11 #6320 @alanmcruickshank
- Snowflake allow double-quoted comments #6318 @greg-finley
- Databricks materialized view #6319 @greg-finley
- Allow double quotes to be escaped by writing twice #6316 @alanmcruickshank
- Resolve an oscillation bug with LT02 #6306 @alanmcruickshank
- Create a "Guides and Howtos" section of the docs. #6301 @alanmcruickshank
- Add groups to the
github-annotation-nativeformat option. #6312 @alanmcruickshank - Snowflake: Support CTEs and multiple orders of CopyOptions in COPY INTO #6313 @keraion
- Allow expressions in ORDER BY for clickhouse #6311 @alanmcruickshank
- Snowflake: support temp UDFs #6309 @rogalski
- fix: tsql create function syntax corrections #6289 @nspcc-cm
New Contributors
[3.2.2] - 2024-10-07
Highlights
This is a hotfix release to resolve an issue with the JJ01 rule when running in parallel mode.
What’s Changed
- Hotfix for JJ01 #6304 @alanmcruickshank
- Add note on 3.0.x to main docs page. #6302 @alanmcruickshank
[3.2.1] - 2024-10-06
Highlights
This release is primarily housekeeping, bugfixes and dialect improvements. More specifically:
- Resolving regressions regressions in
JJ01, filename extension handling and the treatment of unfixable/unparsable files, which have been noticed with recent releases. - Resolving bugs in
LT07<12which relate to jinja whitespace control. - More robust support for arbitrary methods on the
refandsourcemacros for the dbt templater.
There's also dialect improvements for BigQuery, TSQL, MySQL, MariaDB, Snowflake, DuckDB, Databricks, Postgres, Teradata, Exasol & Vertica.
We also saw six new contributors merge their first pull request as part of this release. Welcome to the project! 🎉🏆🎉
What’s Changed
- Postgres: Support walrus operator named arguments #6299 @keraion
- TSQL: handle nested joins, RF01 better aliasing #6300 @keraion
- Exclude Macros - Allow multiple paths. #6221 @culpgrant
- Dededuplicate rule ignore docs #6296 @alanmcruickshank
- Bugfix for LT07 with consumed newlines. #6294 @alanmcruickshank
- Bugfix for LT12 with jinja whitespace consumption #6292 @alanmcruickshank
- RF02: Ignore
DECLAREvariables in BigQuery #6295 @keraion - Bugfix for JJ01 in parallel mode #6293 @alanmcruickshank
- Allow arbitrary attributes & methods for
ThisEmulator#6254 @mroy-seedbox - RF05: Add
table_aliasesoption #6273 @keraion - BigQuery: Add support for concatenating in
EXECUTE IMMEDIATE#6287 @keraion - BigQuery: Add support for
SETwith system variables #6288 @keraion - Plugins: Migrate example plugin to
pyproject.toml#6286 @keraion - TSQL: Add DATETRUC to date_part_function_name list #6283 @paysni
- MySQL Alter table convert to character set #6277 @greg-finley
- Remove dependency on coveralls. #6284 @alanmcruickshank
- Test dbt Templater Plugin with dbt 1.9.0 #6280 @edgarrmondragon
- AM06: Ignore array expressions in BigQuery #6276 @keraion
- Add mariadb to issue labeler #6278 @greg-finley
- BigQuery: Add
GROUPING SETSclause #6275 @keraion - Snowflake: Support
ARRAYtypes #6272 @keraion - Move most of the config validation settings out into rule bundles. #6262 @alanmcruickshank
- Revise warnings with fixing unfixable files. #6257 @alanmcruickshank
- Strict mypy on
sqlfluff.core#6246 @alanmcruickshank - DuckDB: Add
DROP MACRO#6270 @keraion - Added Support for Databricks SQL Notebook Cells #6267 @gabepesco
- dbt templater
pyproject.tomlnits #6268 @alanmcruickshank - Add UTF8 support for identifiers in Vertica dialect #6183 @troshnev
- Almost all of
utilup to strict typing #6263 @alanmcruickshank - Update link to diff-cover docs #6256 @alanmcruickshank
- MySQL: AL09 handle double quoted identifiers #6249 @keraion
- fix: complex file extensions discovery #6228 @Clepech
- fix RF06 issue in postgres naked identifier regex #6247 @fvankrieken
- Strict typing for
sqlfluff.core.linter#6240 @alanmcruickshank - DuckDB: Fixed
DatatypeSegmentreferences #6244 @keraion - Postgres: Support
SETwith double quoted identifiers #6243 @keraion - Consolidate Teradata tests #6241 @greg-finley
- RF02: Ignore alias references that are self-inner #6242 @keraion
- Add additional CREATE TABLE support for Databricks #6216 @pahunter90
- Complete the support for PIVOT in Snowflake dialect #6217 @fpsebastiam
- Exasol - allow function calls in values clause #6226 @stephnan
- Snowflake: Support defining virtual columns #6237 @babak-l1
- Teradata order of VOLATILE and MULTISET #6233 @greg-finley
- Remove duplicate timing columns from the timing records #6229 @Tenzer
- Fix time travel clauses in Snowflake dialect #6230 @fpsebastiam
New Contributors
- @fpsebastiam made their first contribution in #6230
- @Tenzer made their first contribution in #6229
- @Clepech made their first contribution in #6228
- @troshnev made their first contribution in #6183
- @gabepesco made their first contribution in #6267
- @mroy-seedbox made their first contribution in #6254
[3.2.0] - 2024-09-18
Highlights
This release brings a few minor breaking changes, both for the core project and for the dbt templater. For the main project:
-
Resolving an issue with the spacing of functions (LT01), which involved a change to how functions are parsed. If your project relies on the specific parsing of functions, the bracketed arguments are now wrapped in a
function_contentsobject. We recommend that you examine the new parsing structure using this new release in testing first. -
RF06(references.quoting) is now case sensitive when removing quotes which are detected as unnecessary. This rule has also been re-enabled by default for Snowflake and Postgres where it had previously been disabled (for the reason that in the past it hadn't been appropriately case sensitive). Treatment for totally case-insensitive dialects like DuckDB and SparkSQL have also been included. Please check the new documentation for this rule (which is much more explicit now), for details related to your dialect. -
Patterns equivalent to those from
.sqlfluffignorecan now be included in.sqlfluffandpyproject.tomlfiles. -
Using the
pythontemplater, users now have an option to include variables which include a dot in the path, like{{ foo.bar }}using a specialsqlfluffcontext variable. -
Significant changes under the hood to the handling of configuration files. Most of these should not be visible to end users, but for anyone integrating SQLFluff into a larger project and relying on native file loading may need to refactor their project for this release. Most notably here, for maintainers of plugins, the
ConfigLoaderclass has been deprecated, and plugins should instead call the config loading functions directly. See the example plugin for details. -
Documentation, especially for dialects, has been significantly improved. Documentation for
CP02(capitalisation.identifiers) has also been clarified to make it's implication for references and aliases more clear. -
During testing, to isolate the effect of specific rules, there's a new CLI option
--disable-noqa-exceptwhich allows allnoqaoptions to be ignored except the ones provided in this option.
For the dbt templater:
-
Support for dbt 1.1-1.3 has been removed. All have been in End of Life (EOL) support by dbtlabs for almost two years. They are also poorly supported by other projects and tools.
-
The dbt templater has been migrated to use
pyproject.toml. -
Handling of errors and exceptions raised within dbt has had an overhaul. Users may see a slightly different presentation of errors, but the overall stability should be more robust.
In addition to those changes, there have been too many dialect contributions and bugfixes to mention specifically. We've also seen six people make their first contributions to the project as part of preparing for this release! 🎉🏆🎉.
What’s Changed
- Handle multi-processing dbt exceptions much better. #6138 @alanmcruickshank
- Support variables with dot in python templater #5872 @timchurch
- Add postgres normalization operator support #6211 @fnimick
- Fix patch will anchor on first buffer insertion point #6212 @keraion
- Allow ignore patterns in other config files. #6130 @alanmcruickshank
- Strict typing in
configandhelpers. #6206 @alanmcruickshank - TSQL: Support multiple options in
SETstatement #6205 @keraion - DuckDB: Support
CREATE TYPEstatement #6204 @keraion - Update Slack link #6203 @greg-finley
- Add quoted literal checking for Snowflake TARGET_LAG in dynamic tables. #6201 @mvastarelli
- Databricks: Support
COMMENT ONstatement #6196 @keraion - DuckDB: Support
STRUCTdatatype #6198 @keraion - Deprecate the
ConfigLoader#6177 @alanmcruickshank - DuckDB: Support
CREATE MACRO/CREATE FUNCTION#6194 @keraion - DuckDB: Support functions with walrus operators #6193 @keraion
- Add volume syntax support for Databricks #6179 @TheCleric
- Handle errors better in AL09 #6186 @alanmcruickshank
- Add support for managed locations to databricks dialect schemas #6182 @TheCleric
- MYSQL: Create Table Optional AS #6109 @WittierDinosaur
- More dialect documentation #6165 @alanmcruickshank
- Better documentation on how to cross reference rules and fix a few. #6162 @alanmcruickshank
- RF06: Case Sensitivity #6173 @alanmcruickshank
- SparkSQL/Databricks: Support for
VARIANTtype #6167 @keraion - sparksql: Allow
INSERT OVERWRITEafter a CTE #6172 @keraion - postgres: Add
SET CONSTRAINTSstatement #6171 @keraion - TSQL: Fix
MERGEwithout a target alias #6170 @keraion - TSQL: add
OFFSETandFETCH#6169 @keraion - postgres: Add support for
SUBSCRIPTIONstatements #6168 @keraion - Duckdb: Add support for list comprehensions #6166 @keraion
- Update Docs and tests for CP02 #6163 @alanmcruickshank
- Cached property in RF06 rather than DIY #6164 @alanmcruickshank
- CI: Update
util.pyfor dbt templaterpyproject.toml#6160 @keraion - Auto generate dialect docs #6153 @alanmcruickshank
- Deprecate support for dbt 1.1-1.3 #6159 @WittierDinosaur
- ST08: Ignore
DISTINCTs with subqueries #6146 @keraion - Duckdb: Fix Create View coverage #6158 @WittierDinosaur
- Snowflake: Support Password Policies #6154 @WittierDinosaur
- Postgres: Allow negative integers in sequences #6111 @WittierDinosaur
- Postgres: Add SHOW Statement #6110 @WittierDinosaur
- Migrate dbt templater to pyproject.toml #6155 @keraion
- Snowflake: Add DEFAULT option for function parameters #6145 @keraion
- Snowflake: fixes parsing for INCLUDE_METADATA in COPY INTO statement #6150 @jcrobak
- [SNOWFLAKE] Adding support for extended constraint definitions #6151 @babak-l1
- Snowflake: fixes parsing for PARSE_HEADER in FILE FORMAT statement #6149 @jcrobak
- fix: avoid strip_newlines when encounter comments in inline segments #6140 @Cynthia-Cheng
- More robust exception handling for dbt. #6144 @alanmcruickshank
- postgres: Add
ENCRYPTED PASSWORDoption inCREATE USER#6143 @keraion - Fix support of INTERVAL in ClickHouse #6112 @Pavel-Strybuk
- Add support for Snowflake Higher-Order Functions #6136 @amardatar
- Method extraction and more robust typing in config. #6135 @alanmcruickshank
- Add missing databricks and sparksql ALTER statements #6102 @pahunter90
- fix: program_counter move in JinjaTracer (#6121) #6123 @Cynthia-Cheng
- CI: allow hidden file upload for coverage files #6139 @keraion
- Fix: added DOWNSTREAM keyword for TARGET_LAG on dynamic tables in Snowflake. #6131 @mvastarelli
- Trino Dialect: update ARRAY type handling #6127 @kirkhansen
- Split apart config module #6128 @alanmcruickshank
- Add option for allowing only a subset of rules for noqa #6115 @keraion
- TSQL: Allow for empty catch block in try-catch #6116 @keraion
- Change evaluation order of literals before column refs in bracketed, delimited expressions #6117 @keraion
- Fix spacing rules for functions #5809 @WittierDinosaur
- SQLite: Add conflict_clause to unique table constraint #6106 @WittierDinosaur
- SQLite: Support Raise Function #6108 @WittierDinosaur
- SQLite: Create Trigger WHEN optionally bracketed #6107 @WittierDinosaur
- Snowflake: Added
INTERVALs to Frame Clause #6105 @keraion - Postgres: Add
IS UNKNOWN#6094 @keraion - RF02: Handle subquery column qualification #6091 @keraion
- tsql: Allow leading dots in table references #6093 @keraion
New Contributors
- @mvastarelli made their first contribution in #6131
- @Cynthia-Cheng made their first contribution in #6123
- @pahunter90 made their first contribution in #6102
- @amardatar made their first contribution in #6136
- @jcrobak made their first contribution in #6149
- @babak-l1 made their first contribution in #6151
[3.1.1] - 2024-08-20
Highlights
This release brings a bumper lot of bugfixes, dialect improvements and other minor improvements across the board. Most notably:
- A rework of the structure of the docs. NOTE: This does change the url
of some docs pages, but to prevent future moves, we've also provided
permalinks to most important pages and rules. See the
conf.pyfile in thedocsfolder for a full list of permalinks. - Solving rule conflicts between LT02 & LT02.
- Bugfixes to AM07, CV11, ST03, ST05 & RF03,
- Removes some redundant dependencies in for the dbt templater (which haven't
been required for some time, but have been included in the install dependencies).
Specifically:
markupsafe,ruamel.yaml,pydantic&rich. - And too many dialect improvements to summarise!
We've also seen eleven new contributors to the project! Thanks to all of them for taking the time to contribute. 🎉🎉🏆🎉🎉
What’s Changed
- dbt Templater: Increase
dbt depstest fixture timeout #6088 @keraion - SparkSQL + Databricks: Add support for raw string literals #6089 @D-to-the-K
- fixes #4855 - Add DECLARE statement in snowflake dialect #6059 @YungChunLu
- Adding CTE to mysql views #6077 @gone
- Rationalise config discovery routines. #6080 @alanmcruickshank
- fix(dialect-trino): Trino ROW datatype definition in queries #6085 @bonisb
- Databricks: Add support for GROUP BY ALL #6082 @D-to-the-K
- fix(clickhouse): add support for tuple() and ENGINE MergeTree #6079 @ogirardot
- Add perma-links for rules #6066 @alanmcruickshank
- fix(clickhouse): add support for rename statement #6073 @ogirardot
- fix(clickhouse): add support for INTO OUTFILE and supported FORMATs #6065 @ogirardot
- LT04: Fix indentation conflict with LT02 #6068 @keraion
- pre-commit: Disable progress bar #6069 @keraion
- feat(clickhouse): add support for decimal(x,y), decimal32(x) and match #6063 @ogirardot
- Big docs refactor. #6052 @alanmcruickshank
- ST05: Handle set statement's subsequent queries #6062 @keraion
- fix(clickhouse): add support for limit by and bracketed format #6061 @ogirardot
- fix(clickhouse): add support for DateTime64(precision, tz) and Tuples() #6060 @ogirardot
- Copy statement postgres v9 compatibility support #5181 @Fullcure3
- Run dbt tests in py312 by default #5861 @alanmcruickshank
- Extract path discovery routines from config and linter. #6057 @alanmcruickshank
- MySQL: Added SET TRANSACTION parsing #5781 @Xemptuous
- Support declare or replace variable statement for Databricks dialect #6054 @urosstan-db
- Exclude Macros from a path provided #6031 @culpgrant
- ST03: Detect CTE usage in nested
WITHclauses #6017 @keraion - TRINO: support FILTER after WITHIN GROUP agg expression #6056 @rileymcdowell
- Fix/snowflake double quotes #5727 @Starstruckk
- bq_table_function : Added functionality to parse table functionsin BigQuery #5480 @moh-lch
- Fix Athena Partitioned By format for iceberg tables #5399 @jverhoeks
- fix: redshift dialect, EXTENSION added #6025 @rafalbog
- Fix ignored inline rule overrides (#5697) #6010 @alesbukovsky
- Update the docs on RF03 #6051 @alanmcruickshank
- RF03: Fixed some subquery reference scenarios #6046 @keraion
- CV11: Remove rogue print statement #6047 @keraion
- Snowflake: fixes parsing for AGGREGATE in CREATE FUNCTION statement #6049 @hawle
- Snowflake:adds optional IF NOT EXISTS to ADD COLUMN #6050 @hawle
- Replace types-pkg-resources with types-setuptools #6039 @keraion
- Remove old deps for dbt templater #6028 @alanmcruickshank
- Added GENERATED AS IDENTITY support to DataBricks dialect #6004 @nicolb2305
- Add support for Clickhouse ORDER BY WITH FILL #6018 @snikch
- Parse API example #6021 @alanmcruickshank
- Add additional dateparts from DATEPART() #6012 @yorickbouma
- MariaDB: Add support for GROUP BY ... ASC/DESC and GROUP BY ... WITH ROLLUP #6009 @pprkut
- AM07: Handle set expressions with bracketed selects #6005 @keraion
- MariaDB: Add support for DELETE/INSERT/REPLACE ... RETURNING #6008 @pprkut
- MariaDB: Add mariadb specific syntax for generated columns #6007 @pprkut
- Snowflake: fixes drop column if exists parsing rules #5999 @hawle
- Fix TSQL Post Table Expr intrepreted as function #6001 @ulixius9
New Contributors
- @yorickbouma made their first contribution in #6012
- @snikch made their first contribution in #6018
- @nicolb2305 made their first contribution in #6004
- @alesbukovsky made their first contribution in #6010
- @rafalbog made their first contribution in #6025
- @jverhoeks made their first contribution in #5399
- @moh-lch made their first contribution in #5480
- @Starstruckk made their first contribution in #5727
- @culpgrant made their first contribution in #6031
- @urosstan-db made their first contribution in #6054
- @ogirardot made their first contribution in #6060
- @D-to-the-K made their first contribution in #6082
- @bonisb made their first contribution in #6085
- @gone made their first contribution in #6077
- @YungChunLu made their first contribution in #6059
[3.1.0] - 2024-07-03
Highlights
This minor release has two breaking changes:
- The addition of camelCase in the extended capitalisation policy. This change removes the ability to autodetect PascalCase, from now on PascalCase, and camelCase must be explicitly set in the config if desired.
- The detection method for sqlfluff config has changed. It should now be more consistent, regardless of how deep if the directory structure you run the command from.
This release also brings in support for the MariaDB dialect. As well as this, there are many bugfixes, and dialect improvements.
Thanks also to the twelve new contributors whose work was included in this release! 🎉🎉🏆🎉🎉
What’s Changed
- Snowflake: alter procedure & function updates #5997 @hawle
- Snowflake: fix connect by prior selects #5996 @hawle
- Snowflake: adds EVENT TABLE support #5995 @hawle
- Feature/MariaDB dialect #5856 @Xemptuous
- Postgres: Fix multiline concat for special literals #5965 @keraion
- ST05: Evaluate nested queries as a whole #5990 @keraion
- Naïve multi-variant jinja linting #5822 @alanmcruickshank
- Update Snowflake Unpivot Dialect to INCLUDE/EXCLUDE NULLs #5961 @danatmercury
- Snowflake: Adds parsing fixes for external access integrations in create procedure and function #5986 @hawle
- Select Analysis: Don't recursively crawl merge subselects #5981 @keraion
- Parent dir config search #5958 @j-svensmark
- Enable AM02 for bigquery, clickhouse, databricks, db2 #5979 @WittierDinosaur
- Add COMMENT ON support to Trino dialect #5984 @tunetheweb
- Snowflake: fix scriptless stored procedure parsing #5982 @hawle
- Add support for custom JinjaTracer implementations #5937 @james-johnston-thumbtack
- MySQL: Fix variable handlings inside expressions #5967 @kzosabe
- Allow anonymous PIVOTs in Databricks #5968 @TheCleric
- Rebreak: Fix meta dedent segment order #5972 @keraion
- Update athena dialect for CTAS #5974 @KulykDmytro
- fix(dialect-trino): Support Grouping Sets #5970 @eskabetxe
- BigQuery: Support various DROP statements #5966 @kzosabe
- AL07: Fix self-referencing table aliases #5963 @keraion
- Clickhouse 'create view' support #5910 @DimaSamodurov
- Capitalisation: Add camelCase #5777 @WittierDinosaur
- Exasol: Use ANSI value_clause to handle insert_stmts correctly #5959 @stephnan
- Support quoted psql parameters with
placeholdertemplater #5880 @fvankrieken - Don't indent invisible template slices #5938 @james-johnston-thumbtack
- 5944: Add support for databricks named parameters #5946 @TheCleric
- Add support for Databricks TRACK HISTORY #5948 @TheCleric
- BigQuery: Support various ALTER statements #5943 @kzosabe
- ClickHouse query-level SETTINGS support #5941 @pheepa
- MySQL: Add support for generated columns #5939 @pprkut
- Exasol: add REGEXP_LIKE #5936 @stephnan
- SQLite: Over clause support for window functions #5935 @atishay
- T-SQL: Parameter assignment in SELECT vs alias #5934 @drjwelch
- SQLite: Add named parameters support #5914 @atishay
- SQLite: Support with key as a column name (as needed by json_each) #5918 @atishay
- Add loader_search_path setting to Jinja templater #5930 @james-johnston-thumbtack
- SQLite: Add support for JSON functions. Fixes #5896 #5917 @atishay
- dbt Templater: Suppress dbt 1.8 log messages #5907 @keraion
- Clarify docs around subdir handling when loading macros #5924 @james-johnston-thumbtack
- fix: add missing comma in Snowflake file types list #5923 @gvozdvmozgu
- SQLite: Specialize create view with support for temporary views. #5919 @atishay
- BigQuery: Fix array type parsing #5912 @kzosabe
- BigQuery: Support unimplemented alter table and view statements #5911 @kzosabe
New Contributors
- @atishay made their first contribution in #5919
- @drjwelch made their first contribution in #5934
- @stephnan made their first contribution in #5936
- @pprkut made their first contribution in #5939
- @pheepa made their first contribution in #5941
- @TheCleric made their first contribution in #5948
- @fvankrieken made their first contribution in #5880
- @DimaSamodurov made their first contribution in #5910
- @eskabetxe made their first contribution in #5970
- @hawle made their first contribution in #5982
- @danatmercury made their first contribution in #5961
- @Xemptuous made their first contribution in #5856
[3.0.7] - 2024-05-23
Highlights
This is primarily a fix for compatibility with dbt 1.8+. Beyond that it also brings several dialect improvements to SQLite, Bigquery, MySQL, Oracle & Clickhouse.
Thanks also to the five new contributors whose work was included in this release! 🎉🎉🏆🎉🎉
What’s Changed
- Add more minor features and fixes to sqlite dialect #5894 @Enduriel
- Fix Clickhouse identifiers format #5890 @Pavel-Strybuk
- Add full support for on conflict clause in SQLite #5888 @Enduriel
- dbt Templater Plugin: dbt 1.8 support #5892 @keraion
- Added support for oracle materialized view #5883 @harshsoni2024
- BigQuery: Support ALTER TABLE ADD KEY statements #5881 @kzosabe
- MySQL: Support DIV and MOD operators #5879 @kzosabe
- Update documentation to include all templaters #5873 @timchurch
- MySQL: Define date part function names #5874 @kzosabe
- Remove typing_extensions requirement #5860 @qarkai
- BigQuery: Fix EXPORT DATA statement #5859 @kzosabe
- BigQuery: Support CREATE INDEX statements #5858 @kzosabe
New Contributors
- @qarkai made their first contribution in #5860
- @timchurch made their first contribution in #5873
- @harshsoni2024 made their first contribution in #5883
- @Enduriel made their first contribution in #5888
- @Pavel-Strybuk made their first contribution in #5890
[3.0.6] - 2024-05-06
Highlights
This release primarily fixes an issue introduced by the recent dbt 1.7.14 release, and better support for dbt 1.7+. It also includes a range of dialect improvements and CLI refinements.
This release also includes the groundwork for linting the unrendered sections of Jinja templates. More documentation on this will be released in due course when it's ready for beta testing.
Thanks also to @padraic00 & @burhanyasar who made their first contributions in this release. 🎉🎉🏆🎉🎉
What’s Changed
- [fix_clickhouse] Temporary Table Create AS SELECT #5843 @konnectr
- Bugfix: ST02 - Compare entire condition expression #5850 @WittierDinosaur
- Clichouse prewhere #5849 @konnectr
- BigQuery: Support missing DROP statements #5848 @kzosabe
- BigQuery: various CREATE statements #5846 @greg-finley
- BigQuery Alter Schema #5835 @greg-finley
- Snowflake execute immediate from #5836 @greg-finley
- Support dbt 1.7 #5842 @WittierDinosaur
- Postgres: Create extension cascade #5834 @greg-finley
- Postgres: Add Support for PostGIS operators #5830 @burhanyasar
- Db2: Support additional CREATE INDEX options #5827 @keraion
- Allow to align all siblings when respacing #5826 @borchero
- BigQuery: Support EXECUTE IMMEDIATE #5820 @keraion
- BigQuery: Support CREATE ROW ACCESS POLICY statement #5821 @kzosabe
- Fix Jinja variant location correction #5814 @alanmcruickshank
- Test cases for linter fails. #5815 @alanmcruickshank
- BigQuery: Support nested BEGIN, Fix CREATE PROCEDURE OPTIONS #5816 @keraion
- Bring multiple jinja variants through to the parser. #5794 @alanmcruickshank
- Fix placeholder labelling #5813 @alanmcruickshank
- Tighten up the return from .process() #5810 @alanmcruickshank
- BigQuery: Support CREATE MATERIALIZED VIEW AS REPLICA OF #5811 @kzosabe
- BigQuery: Support OPTIONS in CREATE FUNCTION statement #5812 @kzosabe
- TSQL: fix
ALTER TABLE ... SWITCH PARTITION#5807 @keen85 - SparkSQL: Add functions that use UNIT keywords #5806 @keraion
- CLI: Add
--stdin-filenameoption #5805 @keraion - TSQL: parse
CREATE/ALTER/DROP MASTER KEY#5802 @keen85 - Jinja Variant Configuration #5785 @alanmcruickshank
- Small refactor in jinja templater #5786 @alanmcruickshank
- BigQuery: Support FOR SYSTEM_TIME AS OF in CREATE TABLE CLONE statement #5798 @kzosabe
- TSQL: support for
CREATE/ALTER PARTITION FUNCTION/SCHEME#5793 @keen85 - BigQuery: Support DEFAULT COLLATE segment #5790 @kzosabe
- TSQL: support computed columns #5792 @keen85
- Simplify one of the lexer methods #5788 @alanmcruickshank
- Improve light colour highlight #5784 @alanmcruickshank
- SparkSQL: Support TIMESTAMP_LTZ and TIMESTAMP_NTZ types #5783 @padraic00
New Contributors
- @padraic00 made their first contribution in #5783
- @burhanyasar made their first contribution in #5830
[3.0.5] - 2024-04-19
Highlights
This release contains one larger change, which is a big upgrade to case sensitivity in the alias use rules. Also allowing the customisation of how SQLFluff uses case sensitivity in rules like AL05. Beyond that, this also includes a handful of dialect improvements.
Thanks especially to @olshak, @MarkPaulin, @mhoogendoorn & @kawashiro who made their first contributions in this release! 🚀
What’s Changed
- BigQuery: Support CREATE SNAPSHOT TABLE statement #5779 @kzosabe
- Upgrades to release actions. #5774 @alanmcruickshank
- Improve Snowflake syntax support #5770 @kawashiro
- TSQL: allow 'OR ALTER' on 'CREATE TRIGGER' #5772 @mhoogendoorn
- Enhancement: Improved Identifiers - casefolding, quoted values, and basic escaping #5726 @keraion
- TSQL: Fix bare functions in default constraints #5771 @MarkPaulin
- MySQL: Fix parsing 'ALTER TABLE ts ADD COLUMN modified_at TIMESTAMP NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP;' (#5766) #5767 @olshak
New Contributors
- @olshak made their first contribution in #5767
- @MarkPaulin made their first contribution in #5771
- @mhoogendoorn made their first contribution in #5772
- @kawashiro made their first contribution in #5770
[3.0.4] - 2024-04-07
Highlights
This is a standard bugfix release bringing a bunch of dialect improvements and bugfixes. Almost every dialect sees some improvements and it also includes quality of life improvements to the CLI, pre-commit hooks, docs and several rules.
Thanks also to the eight new contributors whose first contributions are included in this release. 🎉🎉🏆🎉🎉
What’s Changed
- TSQL: Move PROPERTY to unreserved #5759 @WittierDinosaur
- Mysql: Add Character Set Literals #5755 @WittierDinosaur
- Snowflake: Support ASOF Joins #5756 @WittierDinosaur
- Mysql: Support scoped function calls #5757 @WittierDinosaur
- Postgres: Support pgvector vector type #5758 @WittierDinosaur
- SQLite: Support RETURNING Clause #5760 @WittierDinosaur
- Postgres: Allow return control structures in atomic functions #5761 @WittierDinosaur
- ST04: Retain comments when flattening
CASE#5753 @keraion - dbt templater: Raise UserError when using stdin #5752 @keraion
- SQLite: Add
GLOB,MATCH. ImprovedREGEXP#5745 @keraion - Databricks: Fix Aliases for Join-like objects #5748 @keraion
- Add missing README ref, and issues labels #5741 @WittierDinosaur
- Qual: Add pre-commit to CI #5730 @mdeweerd
- Added support for 'greater/less than or equal' on ANSI CASE statement #5728 @IliyanKostov9
- Remove
--forceflag from pre-commit hook definition #5739 @borchero - adding snake_case to CP01 extended_capitalisation_policy #5736 @alecsgonz
- ST04: Ignore simplifying
CASEs with different expressions #5735 @keraion - Fix #5724 mysql: Allow Line comments without space after -- #5731 @mdeweerd
- Fix spelling #5729 @mdeweerd
- Fix implementation for view_column_name_list in BigQuery's CREATE VIEW #5738 @kzosabe
- CLI: Suppress tracebacks on render/fix/format #5734 @keraion
- Clickhouse: add parsing for select except clause #5725 @tojahech
- Add array type support to Trino dialect #5722 @kirkhansen
- Fix/snowflake unparsable tag in create stmt #5720 @mariq41
- Fix/snowflake ext storage #5714 @mariq41
- Clickhouse: add parsing for "distinct on" syntax #5716 @tojahech
- added refresh mode init on create table statement #5715 @IliyanKostov9
- added
ifNotExistsGrammarto Snowflake procedure #5709 @IliyanKostov9 - Trino: 'TIMESTAMP(p)' no longer triggers LT01 #5711 @rileymcdowell
- Snowflake: add support for streamlit #5692 @vgw-chriskruger
New Contributors
- @vgw-chriskruger made their first contribution in #5692
- @IliyanKostov9 made their first contribution in #5709
- @tojahech made their first contribution in #5716
- @mariq41 made their first contribution in #5714
- @kirkhansen made their first contribution in #5722
- @kzosabe made their first contribution in #5738
- @mdeweerd made their first contribution in #5729
- @alecsgonz made their first contribution in #5736
[3.0.3] - 2024-03-22
Highlights
This is a standard minor release fixing a set of dialect issues with Trino, BigQuery, Vertica and Snowflake.
Thanks to @maegan-canva, @rileymcdowell & @paysni who made their first contributions in this release.
What’s Changed
- [TSQL] Create columnstore indexes #5708 @paysni
- [Vertica] fix gaps for some datatypes, complex alias support, fix group by for DDL #5691 @PolitePp
- BigQuery: Unreserve KEY keyword #5703 @greg-finley
- Trino: Add INTEGER synonym of INT #5702 @rileymcdowell
- Snowflake shouldn't reserve DO as a keyword. #5699 @alanmcruickshank
- Allow use of STREAM in snowflake CHANGES clause #5698 @alanmcruickshank
- Trino: Parse regexp_replace with lambda func #5683 @rileymcdowell
- Documentation update: Remove reference to alias' default config being "consistent" #5689 @maegan-canva
New Contributors
- @maegan-canva made their first contribution in #5689
- @rileymcdowell made their first contribution in #5683
- @paysni made their first contribution in #5708
[3.0.2] - 2024-03-17
Highlights
This is primarily another hotfix release for 3.0.0. Specifically making sure the
deprecation warnings for -f/--force go to stderr rather than stdout. It also
includes two dialect improvements, one for Snowflake and one for T-SQL.
What’s Changed
- Snowflake: Support External Volumes #5684 @WittierDinosaur
- T-SQL: Support Reconfigure #5685 @WittierDinosaur
- CLI: Make
--forcedeprecation print on stderr #5681 @keraion
[3.0.1] - 2024-03-13
Highlights
This minor release is a hotfix to resolve a bug introduced affecting CLI exit codes in the 3.0.0 release.
What’s Changed
- Fix 5673 #5676 @alanmcruickshank
[3.0.0] - 2024-03-12
Highlights
This release brings several breaking changes to previous releases. Most notably:
-
It drops support for python 3.7, which reached end of life in June 2023.
-
It migrates to
pyproject.tomlrather thansetup.cfgas the python packaging configuration file (although keepingsetuptoolsas the default backend). -
The serialised output for
sqlfluff lint(and the corresponding API methods) now contains more information about the span of linting issues, initial proposed fixes and several statistics which were previously only accessible via csv export. Beside the new fields, the original fields ofline_posandline_nohave been renamed tostart_line_posandstart_line_no, to distinguish them from the new fields startingend_*. -
The default
annotation_levelset by the--annotation-leveloption on thesqlfluff lintcommand has been changed fromnoticetowarning, to better distinguish linting errors from warnings, which always now have the level ofnotice. This is only relevant when using thegithub-annotationorgithub-annotation-nativeformats. -
A change in the default behaviour for
convention.not_equals. The new default is to beconsistent, which is slightly more relaxed than the original behaviour. -
The
--forceoption has been deprecated onsqlfluff fixas that option is now the default behaviour. This is to enable significant reductions in memory overhead when linting large projects. -
The long since deprecated
--disable_progress_baroption has been removed (which was replaced by the kabab-case--disable-progress-barmore than a year ago). -
Plugins are now loaded progressively, and with error handling. If a plugin fails to load, SQLFluff will now continue onward and try to run regardless while also showing a more helpful error message.
On top of these changes, there have a been a whole host of dialect improvements
and additions, in particular the inclusion of avertica dialect for the
first time. There's also:
-
A new rule (
aliasing.self_alias.column) which prevents aliasing a column as itself. -
A change to disables AL01 (
aliasing.table) by default for Oracle. -
A change to allow AL05 to allow aliasing for a
VALUESclause.
For more specifics please take a look at the release notes.
Thanks to the community for patience during the release cycle for 3.0.0, which has taken a little longer than expected. Thanks also to the TWENTY SEVEN new contributors whose changes are included in this release. 🎉🎉🏆🎉🎉
What’s Changed
- Progressively load plugins #5661 @alanmcruickshank
- Postgres: AL05, ignore aliases in values clause #5669 @keraion
- Add Postgres CREATE FOREIGN TABLE statement #5657 @edpft
- Lexer: Handle escaped curly brace slices from the python templater #5666 @keraion
- [CI]: Update pre-commit hook versions #5665 @keraion
- Resolves #5624: Snowflake unparsable unset table options #5664 @andychannery
- Revert Ruff Changes #5662 @alanmcruickshank
- Complete the memory overhead work on cli fix #5653 @alanmcruickshank
- Resolve #5647: Snowflake unparsable variant access after cast #5658 @andychannery
- BQ PK and FK #5654 @OTooleMichael
- Prep version 3.0.0a6 #5652 @github-actions
- Add Support for Databricks
CREATE FUNCTIONSyntax in SparkSQL Parser #5615 @mitchellvanrijkom - Swap fix
--forcefor--check#5650 @alanmcruickshank - Remove
DeprecatedOption#5649 @alanmcruickshank - Resolve broken loop limit test #5651 @alanmcruickshank
- Snowflake: Move NOTIFY to non-reserved words #5645 @greg-finley
- BigQuery: GROUP BY ALL #5646 @greg-finley
- chore: use pre-calculated
_code_indicesin `BaseSegment::raw_segmen… #5644 @gvozdvmozgu - Fix Snowflake Semistructured identifier parsing regex-expression #5635 @DannyMor
- Postgres: Update ReferentialActionGrammar to support sets of columns #5628 @WittierDinosaur
- Snowflake: Add syntax for masking policy force #5629 @WittierDinosaur
- Postgres: Allow nested block comments #5630 @WittierDinosaur
- Postgres: Add Create, Alter, Drop Statistics #5631 @WittierDinosaur
- T-SQL Fix relative sql filepath lexer #5632 @WittierDinosaur
- Tech Debt: Replace some sequences with their Ref equivalents #5633 @WittierDinosaur
- ANSI/MYSQL: Support Create Role If Not Exists #5634 @WittierDinosaur
- Add Vertica dialect #5640 @PolitePp
- Add Support for Snowflake Materialised View and Column Masking Policy #5637 @ulixius9
- [snowflake dialect] support ALTER TABLE ... ADD COLUMN IF NOT EXISTS #5621 @gshen7
- SQLite: Make
DISTINCT FROMoptional; SQLite/TSQL/Exasol: Nothing'dNanLiteralSegment#5620 @keraion - Upgrade greenplum dialect #5546 @kkozhakin
- Oracle: parse length qualifier in types #5613 @Jefffrey
- Multiple Dialects: Fix handling of nested sets expressions #5606 @keraion
- DB2: Add labeled durations and special registers #5612 @keraion
- Sparksql: Fix
LATERAL VIEWfollowingJOIN;CLUSTER|SORT|DISTRIBUTE BYorQUALIFYwithoutFROM#5602 @keraion - File helpers and config test parameterisation. #5579 @alanmcruickshank
- Memory overhead optimisations during linting #5585 @alanmcruickshank
- fix: multiple columns foreign key constraint (#5592) #5594 @maoxingda
- [CI] Add
no_implicit_reexportmypy check #5509 @Koyaani - Prep version 3.0.0a5 #5512 @github-actions
- Add support & test for postgres alter policy with multiple clauses #5577 @fnimick
- Update github actions to latest versions #5584 @alanmcruickshank
- Allows using dbt cross project ref in jinja templater #5574 @alangner
- Improve support for Jinja templater plugins with custom tags #5543 @james-johnston-thumbtack
- Databricks: fix
EXCEPTwith qualified column reference #5557 @keraion - Stricter recommended config for not_equals convention #5580 @alanmcruickshank
- CV01: Add options for ANSI and consistent style. #5539 @keraion
- DuckDB: Fix
REPLACEafterEXCLUDE. Fix AL03 linting for wildcard like expression. #5556 @keraion - Clickhouse: Add
GLOBAL JOIN,GLOBAL IN, andPASTE JOIN#5560 @keraion - [Docs] Use extended policy for identifier capitalisation in starter config #5562 @j-svensmark
- Build: linting black 24.1.0 rules update #5573 @keraion
- Snowflake: Updating Snowflake dialect to pass acceptable RLS policy objects #5559 @k1drobot
- Redshift Syntax: ALTER APPEND #5545 @OTooleMichael
- DuckDB: Add ANTI, SEMI, ASOF, and POSITIONAL joins #5544 @keraion
- MySQL: fix FIRST keyword in ALTER ADD/MODIFY #5537 @archer62
- Postgres/DB2/Oracle: Fix comma join
LATERAL. #5533 @keraion - Add new Rule AL09: Avoid Self Alias #5528 @aayushr7
- Rule AL01: disabled for Oracle dialect #5517 @keraion
- Postgres ALTER EXTENSION support: dialect & tests #5527 @remy-gohiring
- SparkSQL: Add
UNPIVOTsyntax. FixTABLESAMPLEaliases. #5524 @keraion - DuckDB: Added support for
PIVOTandUNPIVOT#5514 @keraion - Fix parse error databricks window function starts with order by #5493 @snkekorfus
- Hive: allow UDTF to return multiple column aliases in SELECT #5495 @reata
- DB2: Add support for
DECLARE GLOBAL TEMPORARY TABLES,OFFSET,CALL, and non-bracketedVALUES#5508 @keraion - DuckDB: Add CREATE OR REPLACE TABLE syntax #5511 @keraion
- TSQL: Top and Distinct in same query #5491 @greg-finley
- [Spark/Databricks] Fix: make COLUMNS in APPLY CHANGES INTO optional #5498 @rocwang
- SparkSQL: exclamation mark as logical not #5500 @reata
- SparkSQL: allow value in set_statement to be Java class name #5504 @reata
- SparkSQL: allow distribute/sort/cluster by at end of set operation #5502 @reata
- [CI] Add a few more mypy checks #5505 @Koyaani
- Snowflake dialect: Add support for DATABASE ROLE in GRANT/REVOKE #5490 @sfc-gh-dgupta
- DuckDB: Qualify and From-First #5485 @keraion
- MySql: create table: allow null/not null in any position #5473 @archer62
- Snowflake dialect: Support for CREATE DATABASE ROLE #5475 @sfc-gh-dgupta
- Clickhouse Dialect - Support BackQuoted Identifiers #5457 @kaiyannameighu
- Change Color.lightgrey to have a white background - dark theme friendly #5458 @ryaminal
- Fix indentation for single cube clause #5462 @tunetheweb
- Prep version 3.0.0a4 #5455 @github-actions
- Build out rule and fix serialisation #5364 @alanmcruickshank
- Add warning about github actions annotations limit #5450 @alanmcruickshank
- chore: remove unused line initialization in ParseContext #5448 @gvozdvmozgu
- Refine CLI testing fixture #5446 @alanmcruickshank
- Update black linting #5447 @alanmcruickshank
- Prep version 3.0.0a3 #5444 @github-actions
- fix assertion in
test__api__lint_string_specific_exclude_single#5437 @gvozdvmozgu - Databricks CLUSTER BY and OPTIMIZE #5436 @greg-finley
- TSQL: ON DELETE NO ACTION #5434 @greg-finley
- Snowflake dynamic table #5435 @greg-finley
- Support parsing CONSTRAINT definitions when creating Delta Live Tables in SparkSQL/Databricks #5438 @rocwang
- adds few fixes for databricks/sparksql #5431 @markbaas
- TSQL: CREATE USER {FOR|FROM} LOGIN #5426 @greg-finley
- Snowflake Create table order/noorder #5421 @greg-finley
- Simplify Snowflake regexes #5419 @greg-finley
- Permit .* after each tbl_name in multi-table delete syntax #5408 @yoichi
- Fix snowflake add search optimization grant #5412 @jongracecox
- ANSI: Allow combination of UNION clause and WITH clause #5413 @yoichi
- SQLite: Allow block comments to be terminated by end of input #5400 @WittierDinosaur
- Update publish github action to use kebab case #5392 @alanmcruickshank
- Prep version 3.0.0a2 #5391 @github-actions
- Update publish actions and Dockerfile. #5390 @alanmcruickshank
- Prep version 3.0.0a1 #5381 @github-actions
- Move the rest of pytest over to
pyproject.toml#5383 @alanmcruickshank - Move doc8 over to pyproject #5385 @alanmcruickshank
- Remove exceptions for typing stubs that now exist. #5382 @alanmcruickshank
- Migrate to
pyproject.tomlfor the core project. #5373 @alanmcruickshank - Fix the snippet from a pyproject.toml in configuration.rst #5378 @ishiis
- Snowflake: Support AlterNetworkPolicy Statements #5377 @WittierDinosaur
- postgres: add support for bodies of "language sql" functions #5376 @65278
- Add support for SET NAMES statement in MySQL #5374 @joaostorrer
- Fix GRANT ALL PRIVILEGES statement in MySQL #5375 @joaostorrer
- Another extraction of fixing logic. #5365 @alanmcruickshank
- Remove root requirements.txt #5372 @alanmcruickshank
- Drop support of python 3.7 #5288 @zhongjiajie
- API configuration documentation #5369 @golergka
- add listagg extras support in trino dialect #5368 @wjhrdy
- Allow ignoring of comments from indentation entirely #3311 #5363 @alanmcruickshank
- Trino: Support Analyze statements #5361 @WittierDinosaur
- Resolve #5327 (logging to stdout) #5362 @alanmcruickshank
New Contributors
- @edpft made their first contribution in #5657
- @maoxingda made their first contribution in #5594
- @Jefffrey made their first contribution in #5613
- @kkozhakin made their first contribution in #5546
- @gshen7 made their first contribution in #5621
- @PolitePp made their first contribution in #5640
- @DannyMor made their first contribution in #5635
- @mitchellvanrijkom made their first contribution in #5615
- @ryaminal made their first contribution in #5458
- @sfc-gh-dgupta made their first contribution in #5475
- @archer62 made their first contribution in #5473
- @keraion made their first contribution in #5485
- @Koyaani made their first contribution in #5505
- @snkekorfus made their first contribution in #5493
- @remy-gohiring made their first contribution in #5527
- @aayushr7 made their first contribution in #5528
- @k1drobot made their first contribution in #5559
- @alangner made their first contribution in #5574
- @fnimick made their first contribution in #5577
- @jongracecox made their first contribution in #5412
- @markbaas made their first contribution in #5431
- @rocwang made their first contribution in #5438
- @gvozdvmozgu made their first contribution in #5437
- @wjhrdy made their first contribution in #5368
- @golergka made their first contribution in #5369
- @65278 made their first contribution in #5376
- @ishiis made their first contribution in #5378
[3.0.0a6] - 2024-03-05
Highlights
This introduces some memory optimisations in the linting operation which
prevent a major cause of crashes when linting large projects. As part of that
we've also deprecated the --force option on sqlfluff fix and made that
the default behaviour (the associated memory optimisations will come shortly).
This also removes the long since deprecated --disable_progress_bar option
(which was replaced by the kabab-case --disable-progress-bar more than a
year ago).
On top of that this release also introduces the vertica dialect for the
first time, and a whole host of bugfixes and improvements to other dialects.
This release should be considered a release candidate for the final 3.0.0
release which will follow shortly in the next few days unless any other
major issues are found.
Thanks particularly to the seven new contributors we saw in this release 🏆🎉.
What’s Changed
- Add Support for Databricks
CREATE FUNCTIONSyntax in SparkSQL Parser #5615 @mitchellvanrijkom - Swap fix
--forcefor--check#5650 @alanmcruickshank - Remove
DeprecatedOption#5649 @alanmcruickshank - Resolve broken loop limit test #5651 @alanmcruickshank
- Snowflake: Move NOTIFY to non-reserved words #5645 @greg-finley
- BigQuery: GROUP BY ALL #5646 @greg-finley
- chore: use pre-calculated
_code_indicesin `BaseSegment::raw_segmen… #5644 @gvozdvmozgu - Fix Snowflake Semistructured identifier parsing regex-expression #5635 @DannyMor
- Postgres: Update ReferentialActionGrammar to support sets of columns #5628 @WittierDinosaur
- Snowflake: Add syntax for masking policy force #5629 @WittierDinosaur
- Postgres: Allow nested block comments #5630 @WittierDinosaur
- Postgres: Add Create, Alter, Drop Statistics #5631 @WittierDinosaur
- T-SQL Fix relative sql filepath lexer #5632 @WittierDinosaur
- Tech Debt: Replace some sequences with their Ref equivalents #5633 @WittierDinosaur
- ANSI/MYSQL: Support Create Role If Not Exists #5634 @WittierDinosaur
- Add Vertica dialect #5640 @PolitePp
- Add Support for Snowflake Materialised View and Column Masking Policy #5637 @ulixius9
- [snowflake dialect] support ALTER TABLE ... ADD COLUMN IF NOT EXISTS #5621 @gshen7
- SQLite: Make
DISTINCT FROMoptional; SQLite/TSQL/Exasol: Nothing'dNanLiteralSegment#5620 @keraion - Upgrade greenplum dialect #5546 @kkozhakin
- Oracle: parse length qualifier in types #5613 @Jefffrey
- Multiple Dialects: Fix handling of nested sets expressions #5606 @keraion
- DB2: Add labeled durations and special registers #5612 @keraion
- Sparksql: Fix
LATERAL VIEWfollowingJOIN;CLUSTER|SORT|DISTRIBUTE BYorQUALIFYwithoutFROM#5602 @keraion - File helpers and config test parameterisation. #5579 @alanmcruickshank
- Memory overhead optimisations during linting #5585 @alanmcruickshank
- fix: multiple columns foreign key constraint (#5592) #5594 @maoxingda
- [CI] Add
no_implicit_reexportmypy check #5509 @Koyaani
New Contributors
- @maoxingda made their first contribution in #5594
- @Jefffrey made their first contribution in #5613
- @kkozhakin made their first contribution in #5546
- @gshen7 made their first contribution in #5621
- @PolitePp made their first contribution in #5640
- @DannyMor made their first contribution in #5635
- @mitchellvanrijkom made their first contribution in #5615
[3.0.0a5] - 2024-01-30
Highlights
This release primarily brings through a large set of dialect improvements and bugfixes from over the holiday period. Notably also:
- A change in the default behaviour for
convention.not_equals. The new default is to beconsistent, which is slightly more relaxed than the original behaviour. - A new rule (
aliasing.self_alias.column) which prevents aliasing a column as itself. - Disables
AL01(aliasing.table) by default for Oracle.
This release also saw ELEVEN new contributors in this release 🎉🎉🏆🏆🎉🎉. Great to see so many new people getting involved with the project. Thank You 🙏.
What’s Changed
- Add support & test for postgres alter policy with multiple clauses #5577 @fnimick
- Update github actions to latest versions #5584 @alanmcruickshank
- Allows using dbt cross project ref in jinja templater #5574 @alangner
- Improve support for Jinja templater plugins with custom tags #5543 @james-johnston-thumbtack
- Databricks: fix
EXCEPTwith qualified column reference #5557 @keraion - Stricter recommended config for not_equals convention #5580 @alanmcruickshank
- CV01: Add options for ANSI and consistent style. #5539 @keraion
- DuckDB: Fix
REPLACEafterEXCLUDE. Fix AL03 linting for wildcard like expression. #5556 @keraion - Clickhouse: Add
GLOBAL JOIN,GLOBAL IN, andPASTE JOIN#5560 @keraion - [Docs] Use extended policy for identifier capitalisation in starter config #5562 @j-svensmark
- Build: linting black 24.1.0 rules update #5573 @keraion
- Snowflake: Updating Snowflake dialect to pass acceptable RLS policy objects #5559 @k1drobot
- Redshift Syntax: ALTER APPEND #5545 @OTooleMichael
- DuckDB: Add ANTI, SEMI, ASOF, and POSITIONAL joins #5544 @keraion
- MySQL: fix FIRST keyword in ALTER ADD/MODIFY #5537 @archer62
- Postgres/DB2/Oracle: Fix comma join
LATERAL. #5533 @keraion - Add new Rule AL09: Avoid Self Alias #5528 @aayushr7
- Rule AL01: disabled for Oracle dialect #5517 @keraion
- Postgres ALTER EXTENSION support: dialect & tests #5527 @remy-gohiring
- SparkSQL: Add
UNPIVOTsyntax. FixTABLESAMPLEaliases. #5524 @keraion - DuckDB: Added support for
PIVOTandUNPIVOT#5514 @keraion - Fix parse error databricks window function starts with order by #5493 @snkekorfus
- Hive: allow UDTF to return multiple column aliases in SELECT #5495 @reata
- DB2: Add support for
DECLARE GLOBAL TEMPORARY TABLES,OFFSET,CALL, and non-bracketedVALUES#5508 @keraion - DuckDB: Add CREATE OR REPLACE TABLE syntax #5511 @keraion
- TSQL: Top and Distinct in same query #5491 @greg-finley
- [Spark/Databricks] Fix: make COLUMNS in APPLY CHANGES INTO optional #5498 @rocwang
- SparkSQL: exclamation mark as logical not #5500 @reata
- SparkSQL: allow value in set_statement to be Java class name #5504 @reata
- SparkSQL: allow distribute/sort/cluster by at end of set operation #5502 @reata
- [CI] Add a few more mypy checks #5505 @Koyaani
- Snowflake dialect: Add support for DATABASE ROLE in GRANT/REVOKE #5490 @sfc-gh-dgupta
- DuckDB: Qualify and From-First #5485 @keraion
- MySql: create table: allow null/not null in any position #5473 @archer62
- Snowflake dialect: Support for CREATE DATABASE ROLE #5475 @sfc-gh-dgupta
- Clickhouse Dialect - Support BackQuoted Identifiers #5457 @kaiyannameighu
- Change Color.lightgrey to have a white background - dark theme friendly #5458 @ryaminal
- Fix indentation for single cube clause #5462 @tunetheweb
New Contributors
- @ryaminal made their first contribution in #5458
- @sfc-gh-dgupta made their first contribution in #5475
- @archer62 made their first contribution in #5473
- @keraion made their first contribution in #5485
- @Koyaani made their first contribution in #5505
- @snkekorfus made their first contribution in #5493
- @remy-gohiring made their first contribution in #5527
- @aayushr7 made their first contribution in #5528
- @k1drobot made their first contribution in #5559
- @alangner made their first contribution in #5574
- @fnimick made their first contribution in #5577
[3.0.0a4] - 2023-12-05
Highlights
This release makes a breaking change to the serialized output of the CLI (and by extension, any of the serialized outputs of the API).
-
The serialised output for
sqlfluff lintnow contains more information about the span of linting issues and initial proposed fixes. Beside the new fields, the original fields ofline_posandline_nohave been renamed tostart_line_posandstart_line_no, to distinguish them from the new fields startingend_*. -
The default
annotation_levelset by the--annotation-leveloption on thesqlfluff lintcommand has been changed fromnoticetowarning, to better distinguish linting errors from warnings, which always now have the level ofnotice. This is only relevant when using thegithub-annotationorgithub-annotation-nativeformats.
What’s Changed
- Build out rule and fix serialisation #5364 @alanmcruickshank
- Add warning about github actions annotations limit #5450 @alanmcruickshank
- chore: remove unused line initialization in ParseContext #5448 @gvozdvmozgu
- Refine CLI testing fixture #5446 @alanmcruickshank
- Update black linting #5447 @alanmcruickshank
[3.0.0a3] - 2023-11-29
Highlights
This brings no further breaking changes on top of 3.0.0a2, but instead
releases a few of the more minor fixes flowing through while other breaking
changes are staged in. In particular there are a few dialect improvements
for Snowflake, TSQL, SQLite and Databricks alongsids a few further
improvements to deployment scripts off the back of earlier changes for 3.x.
What’s Changed
- fix assertion in
test__api__lint_string_specific_exclude_single#5437 @gvozdvmozgu - Databricks CLUSTER BY and OPTIMIZE #5436 @greg-finley
- TSQL: ON DELETE NO ACTION #5434 @greg-finley
- Snowflake dynamic table #5435 @greg-finley
- Support parsing CONSTRAINT definitions when creating Delta Live Tables in SparkSQL/Databricks #5438 @rocwang
- adds few fixes for databricks/sparksql #5431 @markbaas
- TSQL: CREATE USER {FOR|FROM} LOGIN #5426 @greg-finley
- Snowflake Create table order/noorder #5421 @greg-finley
- Simplify Snowflake regexes #5419 @greg-finley
- Permit .* after each tbl_name in multi-table delete syntax #5408 @yoichi
- Fix snowflake add search optimization grant #5412 @jongracecox
- ANSI: Allow combination of UNION clause and WITH clause #5413 @yoichi
- SQLite: Allow block comments to be terminated by end of input #5400 @WittierDinosaur
- Update publish github action to use kebab case #5392 @alanmcruickshank
New Contributors
- @jongracecox made their first contribution in #5412
- @markbaas made their first contribution in #5431
- @rocwang made their first contribution in #5438
- @gvozdvmozgu made their first contribution in #5437
[3.0.0a2] - 2023-11-09
Highlights
The initial 3.0.0a1 release failed to build a docker image, this resolves that issue.
What’s Changed
- Update publish actions and Dockerfile. #5390 @alanmcruickshank
[3.0.0a1] - 2023-11-08
Highlights
This release makes a couple of potentially breaking changes:
-
It drops support for python 3.7, which reached end of life in June 2023.
-
It migrates to
pyproject.tomlrather thansetup.cfgas the python packaging configuration file (although keepingsetuptoolsas the default backend).
Further breaking changes may be made as part of the full 3.0.0 release, but this alpha release is designed to test the new packaging changes for any issues before releasing a stable version.
What’s Changed
- Move the rest of pytest over to
pyproject.toml#5383 @alanmcruickshank - Move doc8 over to pyproject #5385 @alanmcruickshank
- Remove exceptions for typing stubs that now exist. #5382 @alanmcruickshank
- Migrate to
pyproject.tomlfor the core project. #5373 @alanmcruickshank - Fix the snippet from a pyproject.toml in configuration.rst #5378 @ishiis
- Snowflake: Support AlterNetworkPolicy Statements #5377 @WittierDinosaur
- postgres: add support for bodies of "language sql" functions #5376 @65278
- Add support for SET NAMES statement in MySQL #5374 @joaostorrer
- Fix GRANT ALL PRIVILEGES statement in MySQL #5375 @joaostorrer
- Another extraction of fixing logic. #5365 @alanmcruickshank
- Remove root requirements.txt #5372 @alanmcruickshank
- Drop support of python 3.7 #5288 @zhongjiajie
- API configuration documentation #5369 @golergka
- add listagg extras support in trino dialect #5368 @wjhrdy
- Allow ignoring of comments from indentation entirely #3311 #5363 @alanmcruickshank
- Trino: Support Analyze statements #5361 @WittierDinosaur
- Resolve #5327 (logging to stdout) #5362 @alanmcruickshank
New Contributors
- @wjhrdy made their first contribution in #5368
- @golergka made their first contribution in #5369
- @65278 made their first contribution in #5376
- @ishiis made their first contribution in #5378
[2.3.5] - 2023-10-27
Highlights
This is a fairly minor release, primarily bugfixes and dialect improvements.
For python API users, there's the addition of a public method on the FluffConfig
object allowing the construction of a config object from multiple strings to
mimic the effect of nested config files in the CLI.
This release also includes a selection of internal refactoring and reorganisation to support future development work.
This also sees the first contributions by @ShubhamJagtap2000 & @kang8, particularly notable in that both were contributions to SQLFluff documentation! 🎉🎉🏆🎉🎉
What’s Changed
- One (very) small typing improvements #5355 @alanmcruickshank
- Unpick dependencies between modules in
sqlfluff.core#5348 @alanmcruickshank - Resolve SparkSQL re-parsing issue + test validation in test suite. #5351 @alanmcruickshank
- Snowflake: Support ALTER MASKING POLICY #5350 @jmks
- Add a public API for nesting config strings. #5349 @alanmcruickshank
- Update handling of dbt compilation errors #5345 @alanmcruickshank
- Snowflake - Extend Column Default Constraint #5343 @WittierDinosaur
- Fix the dbt anchor link in the realworld documentation #5341 @kang8
- Update README.md #5340 @ShubhamJagtap2000
- Logic to render variants of Jinja templates for more coverage. #5339 @alanmcruickshank
- Templater slicing refactoring of
RawFileSlice#5338 @alanmcruickshank - BigQuery: Support multiple statements in the
BEGIN..EXCEPTION..END#5322 @abdel - Remove codecov traces #5337 @alanmcruickshank
New Contributors
- @ShubhamJagtap2000 made their first contribution in #5340
- @kang8 made their first contribution in #5341
[2.3.4] - 2023-10-17
Highlights
This is a fairly small bugfix release, mostly to resolve a bug introduced in 2.3.3 with commas and LT09. This also includes a couple of additional small performance improvements and some dialect improvements for Oracle, BigQuery and MySQL.
Thanks in particular to @bonnal-enzo who made their first contribution as part of this release 🎉🎉🏆🎉🎉.
What’s Changed
- Commas fix in LT09 #5335 @alanmcruickshank
- UUID Comparisons #5332 @alanmcruickshank
- Two depth map performance improvements #5333 @alanmcruickshank
- Stash parent idx with parent reference #5331 @alanmcruickshank
SettoFrozenSetin segment class_types #5334 @alanmcruickshank- Add support for ANY_VALUE( _ HAVING MIN/MAX _ ) to BigQuery dialect #5321 @bonnal-enzo
- Fix parsing error when using quoted slash in Oracle #5323 @joaostorrer
- Add support for functions and procedures calls via database link in Oracle #5326 @joaostorrer
- Fix parsing error with table name '_' in MySQL #5324 @joaostorrer
New Contributors
- @bonnal-enzo made their first contribution in #5321
[2.3.3] - 2023-10-13
Highlights
There's a lot in this release. Most of it is under the covers and so shouldn't cause any breaking changes for most users. If your use case depends on some of the internals of SQLFluff, you may find some breaking changes. The bigger changes are:
- Python 3.12 support is now official (although older releases may also work as only a few changes were required for full 3.12 support).
- We've done a significant re-write of the parsing engine to remove some unnecessary
segment manipulation and get us closer to "single pass" parsing. This changes the
internal API being used on any
.match()methods, and also removes theparse_grammarattribute on any dialect segments. We are not aware of any 3rd party libraries which rely on these APIs however and so have not triggered a more major release. These lead to significant performance improvements during parsing. - Standardisation of terminators in the parser, and the introduction of the
ParseModeoption has enabled the removal of theStartsWith,GreedyUntilandEphemeralSegmentparser classes. - Several validation checks have been revised in this release, which should both improve performance (by reducing duplication), but also be more effective in preventing the application of any fixes which would result in unparsable files.
Alongside the big things this also includes a host of bugfixes, dialect improvements and CI/testing improvements.
This release also sees a bumper crop of new contributors, thanks to @dehume, @andychannery, @Kylea650, @robin-alphasophia, @jtbg, @r-petit, @bpfaust & @freewaydev who all made the first contributions in this release! 🎉🎉🎉
What’s Changed
- Oracle space between alias and column reference #5313 @joaostorrer
- Don't apply LT05 on templated rebreak locations #5096 #5318 @alanmcruickshank
- Disable JJ01 unless jinja active #5319 @alanmcruickshank
- Cache the
BaseSegmenthash in reflow #5320 @alanmcruickshank - Better error reporting for invalid macros #5317 @alanmcruickshank
- Add support for begin atomic functions in Postgres #5316 @joaostorrer
- Fix parsing when statement uses plus_sign_join and function in Oracle #5315 @joaostorrer
- Update rule docs with correct config #5314 @alanmcruickshank
- Resolve #5258. More robust algorithm for multiline fix. #5309 @alanmcruickshank
- BigQuery: Add support for
BEGIN..EXCEPTION...ENDblock #5307 @abdel - Refine placement of metas around templated blocks #5294 @alanmcruickshank
- Extend ruff checking to docstring rules #5302 @alanmcruickshank
- Fix for strange TSQL bugs #5306 @alanmcruickshank
- Staging PR for #5282 #5305 @alanmcruickshank
- Resolve some strange whitespace indentation behaviour #5292 @alanmcruickshank
- Simplify
_process_lint_result#5304 @alanmcruickshank - Performance improvement on segment comparison #5303 @alanmcruickshank
- Refactor LT09 #5299 @alanmcruickshank
- Change drop function to allow DropBehaviourGrammar with space after function name #5295 @joaostorrer
- Resolve click import options on autocomplete #5293 @alanmcruickshank
- Updated docstrings with missing args/returns/etc info, added missing docstrings, minor formatting fixes. #5278 @freewaydev
- Use ruff rule I replace isort #5289 @zhongjiajie
- Snowflake: Parse ALTER DATABASE statement #5284 @jmks
- Snowflake: Parse ALTER ACCOUNT statements #5283 @jmks
- Snowflake: create AlterProcedureStatementSegment #5291 @moreaupascal56
- Rewrite of matching interface #5230 @alanmcruickshank
- Follow noqa in block comments #5133 @daviewales
- Fix insert on conflict with function in Postgres #5286 @joaostorrer
- Add support for Pivot and Unpivot clauses in Oracle #5285 @joaostorrer
- Adding "create table as" for greenplum dialect #5173 @bpfaust
- Update CI to python 3.12 #5267 @alanmcruickshank
- Snowflake: Add CreateResourceMonitorStatementSegment & AlterResourceMonitorStatementSegment #5272 @moreaupascal56
- [TSQL] Add create fulltext index statement segment class #5274 @r-petit
- Snowflake: Add CreateSequenceStatementSegment & AlterSequenceStatementSegment #5270 @moreaupascal56
- Add CommaSegment to AlterWarehouseStatementSegment SET clause #5268 @moreaupascal56
- Snowflake: Parse EXECUTE IMMEDIATE clause #5275 @jmks
- TSQL: Add missing
HISTORY_RETENTION_PERIODsequence to the table option segment #5273 @r-petit - Snowflake: Fix ScalingPolicy and WarehouseType Refs in WarehouseObjectProperties and use ObjectReferenceSegment in AlterWarehouseStatementSegment #5264 @moreaupascal56
- Finish the removal of
GreedyUntil#5263 @alanmcruickshank - Add support for date operations with intervals in Oracle #5262 @joaostorrer
- Change RawSegment
typetoinstance_types#5253 @alanmcruickshank - Revise MatchableType -> Matchable #5252 @alanmcruickshank
- Unnest fixing and re-address validation triggers #5249 @alanmcruickshank
- Resolves #5174: Snowflake alter table constraint #5247 @andychannery
- Bring together the generic segments #5243 @alanmcruickshank
- minor: update docs with correct link to airflow ds_filter #5244 @jtbg
- #5245 - Snowflake dialect: Adds support for variable definitions in scripting blocks #5246 @robin-alphasophia
- Introduce "word" segment #5234 @alanmcruickshank
- #5239 Added (basic) support for properly linted Snowflake scripting #5242 @robin-alphasophia
- Allow Snowflake pipe integration to be a quoted or unquoted #5241 @Kylea650
- Fix LT01 alignment regression #4023 #5238 @alanmcruickshank
- Add support for oracle non ansi joins #5231 @joaostorrer
- add azure_storage_queue and quoted providers #5236 @Kylea650
- Set type automatically within the lexer. #5232 @alanmcruickshank
- Resolve #5225: Snowflake unparsable select replace #5227 @andychannery
- Spark Accessor Grammars #5226 @alanmcruickshank
- Test Script Timing #5228 @alanmcruickshank
- Unify lexer names and types for brackets #5229 @alanmcruickshank
- Resolve #3176: Snowflake unparsable array casting #5224 @andychannery
- BigQuery system time syntax #5220 @greg-finley
- Parser test nits #5217 @alanmcruickshank
- Remove
parse_grammar#5189 @alanmcruickshank - Revise segment whitespace validation #5194 @alanmcruickshank
- Add support for bpchar datatype in postgres #5215 @joaostorrer
- Resolve #5203:
BaseSegment.copy()isolation #5206 @alanmcruickshank - Update Materialize Syntax #5210 @dehume
- Validate fix parsing based on match_grammar #5196 @alanmcruickshank
- Position assertions in BaseSegment #5209 @alanmcruickshank
- MySQL bracketed column constraint #5208 @greg-finley
- Dialect spacing & quoting issues #5205 @alanmcruickshank
- Update comment workflow again #5201 @alanmcruickshank
- Stash PR Number and hydrate later #5200 @alanmcruickshank
- Fix API issues in github comment action #5199 @alanmcruickshank
- Consistency check in root parse #5191 @alanmcruickshank
- PR Comment action #5192 @alanmcruickshank
- Cache python dependencies in GHA #5193 @alanmcruickshank
- Add support for create server, create user mapping and import foreign schema in postgres #5185 @joaostorrer
- Terminators on
Anything()+ Strip most of the otherparse_grammar#5186 @alanmcruickshank - Parse modes for
AnyNumberOf#5187 @alanmcruickshank - Introduce
parse_modeand removeStartsWith&EphemeralSegment. #5167 @alanmcruickshank
New Contributors
- @dehume made their first contribution in #5210
- @andychannery made their first contribution in #5224
- @Kylea650 made their first contribution in #5236
- @robin-alphasophia made their first contribution in #5242
- @jtbg made their first contribution in #5244
- @r-petit made their first contribution in #5273
- @bpfaust made their first contribution in #5173
- @freewaydev made their first contribution in #5278
- @abdel made their first contribution in #5307
[2.3.2] - 2023-09-10
Highlights
Much of this release is internal optimisations and refactoring. We're in the process of upgrading some quite old code in the parser, most of which should not be visible to end users (apart from perhaps some performance improvements!).
This release also allows missing template variables in the placeholder templater to be automatically filled with the name of the variable rather than raising an error (see: #5101).
Beyond that this includes some dialect improvements for DuckDB, SparkSQL, Snowflake, Redshift & Postgres.
Thanks particularly to @shyaginuma, @Fullcure3, @adilkhanekt & @pilou-komoot who made their first contributions as part of this release. 🎉🎉🎉
What’s Changed
- Allow not specifying parameters names when using placeholder templater #5101 @shyaginuma
- Update coverage job to run in the right conditions #5183 @alanmcruickshank
- Duckdb: UNION BY NAME #5176 @greg-finley
- Output coverage report direct to PR #5180 @alanmcruickshank
- Upgrades to the parse fixture generation script #5182 @alanmcruickshank
- Refactor of Sequence match #5177 @alanmcruickshank
- Simplify Greedy Match #5178 @alanmcruickshank
- Quality of life improvements on parse fixture script #5179 @alanmcruickshank
- Lift and shift matching algorithms #5170 @alanmcruickshank
- Capitalise boolean values in example configs, for consistency #5175 @pilou-komoot
- Pull terminator setting up into the base grammar #5172 @alanmcruickshank
- Flip the if in sequence and un-nest #5171 @alanmcruickshank
- SparkSQL: Support CACHE TABLE without query #5165 @reata
- Remove configurable
enforce_whitespace_preceding_terminator#5162 @alanmcruickshank - Adding optional sequence block for columns parsing in Snowflake external tables #5157 @adilkhanekt
- SparkSQL: Support ALTER TABLE SET LOCATION without partition spec #5168 @reata
- Tighten terminators on
Delimited#5161 @alanmcruickshank terminator>terminatorson StartsWith #5152 @alanmcruickshank- Redshift: Support SELECT INTO #5159 @reata
- Duckdb: Integer division #5154 @greg-finley
terminator>terminatorson Delimited grammar #5150 @alanmcruickshank- Tests for unparsable sections #5149 @alanmcruickshank
- Un-nest the delimited match method #5147 @alanmcruickshank
- Grammar .copy() assert no unexpected kwargs #5148 @alanmcruickshank
- Postgres: CLUSTER #5146 @greg-finley
- Postgres alter policy #5138 @Fullcure3
New Contributors
- @Fullcure3 made their first contribution in #5138
- @adilkhanekt made their first contribution in #5157
- @pilou-komoot made their first contribution in #5175
- @shyaginuma made their first contribution in #5101
[2.3.1] - 2023-08-29
Highlights
This release is primarily a performance release, with most major changes aimed at the linting and fixing phases of operation. Most of the longest duration rules (excepting the layout rules) should see noticeable speed improvements.
Alongside those changes, there are a selection of bugfixes and dialect improvements for Oracle, PostgreSQL, Snowflake & TSQL.
What’s Changed
- Postgres: Update returning with alias #5137 @greg-finley
- Reduce copying on _position_segments (improves
fix) #5119 @alanmcruickshank - Import rationalisation #5135 @alanmcruickshank
- Select Crawler Refactor: Part 3 #5115 @alanmcruickshank
- Add support for comparison operators with space in Oracle #5132 @joaostorrer
- Snowflake support for bracketed query after
EXCEPT#5126 @ulixius9 - Treatment of null literals. #5099 #5125 @alanmcruickshank
- Allow double-quoted parameters in create procedure #5131 @greg-finley
- Fix coverage & mypy #5134 @alanmcruickshank
- Ensure Unparsable can be given position. #5117 @alanmcruickshank
- Reduce copying in LintFix instantiation #5118 @alanmcruickshank
- Optimise crawl behaviour of JJ01 #5116 @alanmcruickshank
- Simplify rules with improvement to SegmentSeeker #5113 @alanmcruickshank
- Refactor AM07 #5112 @alanmcruickshank
- Select Crawler Refactor: Part 2 #5110 @alanmcruickshank
- Add support to Hierarchical Queries in Oracle #5108 @joaostorrer
- ✅ Strict MyPy for sqlfluff.core.parser #5107 @alanmcruickshank
- Free up pydocstyle again #5109 @alanmcruickshank
- Postgres: Allow CREATE TABLE INHERITS with no new columns #5100 @greg-finley
- Strict mypy in parser.segments #5094 @alanmcruickshank
- Select Crawler Refactor: Part 1 #5104 @alanmcruickshank
- RF01 & recursive_crawl improvements #5102 @alanmcruickshank
- fix new more restrictive tox #5103 @alanmcruickshank
- Make Day as Non Reserved Keyword #5062 @ulixius9
[2.3.0] - 2023-08-14
Highlights
This release brings one new dialect, two new rules and some changes to the CLI:
- We now support the trino dialect. This is a first version of support, so do post any issues on GitHub in the usual way. This was also the first contribution to the project from @efung 🏆.
ST09/structure.join_condition_order: Which checks whether tables referenced inJOINclauses are referenced in the order of their definition. By default this means that in theONclause, the column referencing the table in theFROMclause should come before the column referencing the table in theJOINclause (e.g.... FROM a JOIN b on a.c = b.c). This rule was also the first contribution to the project from @thibonacci 🏆.AL08/aliasing.unique.column: Which checks that column aliases and names are not repeated within the sameSELECTclause. This is normally an error as it implies the same column has been imported twice, or that two expressions have been given the same alias.- The
--profileroption onsqlfluff parsehas been removed. It was only present on theparsecommand and notlintorfix, and it is just as simple to invoke the pythoncProfilerdirectly. - The
--recursecli option andsqlfluff.recurseconfiguration option have both been removed. They both existed purely for debugging the parser, and were never used in a production setting. The improvement in other debugging messages when unparsable sections are found means that this option is no longer necessary.
Along side these more significant changes this also includes:
- Performance optimisations for
AL04,AL05,AM04,RF01&ST05which cumulatively may save up to 30% on the total time spend in the linting phase for some projects. - Dialect improvements for Oracle & TSQL.
What’s Changed
- Remove IdentitySet #5093 @alanmcruickshank
- Stricter typing in smaller sqlfluff.core.parser #5088 @alanmcruickshank
- Preliminary support of Trino dialect #4913 @efung
- Rename ST09 #5091 @alanmcruickshank
- TSQL: Fix Clustered Index asc/desc #5090 @greg-finley
- Parent references and more efficient path_to #5076 @alanmcruickshank
- New Rule: AL08 - column aliases must be unique #5079 @alanmcruickshank
- Add support for fetch first row(s) only in Oracle #5089 @joaostorrer
- Fix bug around quoted identifiers for ST09 #5087 @thibonacci
- Add strict typing to the templating tracer #5085 @WittierDinosaur
- Remove recurse config #5065 @alanmcruickshank
- ✅ Strictly type dialect #5067 @pwildenhain
- Add new rule ST09: Joins should list the table referenced earlier (default)/later first #4974 @thibonacci
- Remove the internal cProfiler option #5081 @alanmcruickshank
- Optimisation on select analysis #5082 @alanmcruickshank
New Contributors
- @thibonacci made their first contribution in #4974
- @efung made their first contribution in #4913
[2.2.1] - 2023-08-09
Highlights
This is primarily a bugfix release for 2.2.0 which introduced
a bug in the exit_code returned by linting commands which ignored errors
while setting processes > 1.
In addition to that this release introduces bugfixes for:
- Errors raised by two specific
dbtexceptions. - Issues with unwanted logging output when using
-f yamlor-f jsonalongside thedbttemplater.
This also introduces dialect improvements for Oracle and for LIMIT clauses.
Thanks also to @adityapat3l who made their first contribution as part of this release! 🎉🎉🎉
What’s Changed
- Split apart the grammar tests #5078 @alanmcruickshank
- Resolve pickling of errors #5066 #5074 @alanmcruickshank
- Better context based tracking #5064 @alanmcruickshank
- fixing limit handling for bracketed arithmathic operations #5068 @adityapat3l
- Never run in multiprocessing mode with only 1 file. #5071 @alanmcruickshank
- Add dbt 1.6 tests #5073 @alanmcruickshank
- Handle two kinds of dbt errors more gracefully #5072 @alanmcruickshank
- Try to silence dbt logging #5054 #5070 @alanmcruickshank
- Move
_prune_optionswithin_longest_trimmed_match. #5063 @alanmcruickshank - Fix issue 4998 - Add backup and auto refresh grammar to redshift materialized view #5060 @adityapat3l
- Add mypy strict typing for sqlfluff.core.rules #5048 @pwildenhain
- ⬆️ Bump mypy version in pre-commit #5055 @pwildenhain
- Add SQL Plus bind variable support (Oracle) #5053 @joaostorrer
New Contributors
- @adityapat3l made their first contribution in #5060
[2.2.0] - 2023-08-04
Highlights
This release changes some of the interfaces between SQLFluff core and our plugin ecosystem. The only breaking change is in the interface between SQLFluff and templater plugins (which are not common in the ecosystem, hence why this is only a minor and not a major release).
For all plugins, we also recommend a different structure for their imports (especially for rule plugins which are more common in the ecosystem) - for performance and stability reasons. Some users had been experiencing very long import times with previous releases as a result of the layout of plugin imports. Users with affected plugins will begin to see a warning from this release onward, which can be resolved for their plugin by updating to a new version of that plugin which follows the guidelines.
For more details (especially if you're a plugin maintainer) see our release notes.
Additionally this release includes:
- Some internal performance gains which may cumulatively save roughly 10% of the time spent in the parsing phase of larger files.
- Improvements to the Simple API, including the ability to pass in
a
FluffConfigobject directly, and better support for parsing config files directly from strings (see the included example). - A bugfix for
AM06. - A new
--warn-unused-ignoresCLI option (and corresponding config setting) to allow warnings to be shown if anynoqacomments in SQL files are unused. - Improvements to Redshift, Oracle, Clickhouse, Materialize & MySQL dialects.
- A selection of internal improvements, documentation and type hints.
Thanks also to @kaiyannameighu, @josef-v, @aglebov & @joaostorrer who made their first contributions as part of this release! 🎉🎉🎉
What’s Changed
- Mypy: Ephemeral + Tuple Return on .parse() #5044 @alanmcruickshank
- Add support to oracle's global and private temporary tables #5039 @joaostorrer
- Redshift-dialect: Support GRANT USAGE ON DATASHARE #5007 @josef-v
- ✅ Add strict typing for errors module #5047 @pwildenhain
- Less copying in the ParseContext #5046 @alanmcruickshank
- Adding support to use
ADD COLUMN IF NOT EXISTSsyntax onALTER TABLE#5035 @wfelipew - Closes #4815 #5042 @joaostorrer
- Fix for multiprocessing warnings. #5032 @alanmcruickshank
- Mypy gain: Remove unnecessary tuple construction in MatchResult #5045 @alanmcruickshank
- mypy strict in config #5036 @pwildenhain
- strict mypy: match_wrapper & match_logging #5033 @alanmcruickshank
- MyPy on errors, helpers, markers & context + remove ParseContext.denylist #5030 @alanmcruickshank
- Warn on unused
noqadirectives #5029 @alanmcruickshank - Even more mypy strict #5023 @WittierDinosaur
- Handle windows paths better in config files. #5022 @alanmcruickshank
- Fix for parsing of Oracle functions with named arguments #5027 @joaostorrer
- DOC: Fix .sqlfluff example in Getting Started #5026 @aglebov
- Fix: Add exception to the warning & config for the BaseRule. #5025 @alanmcruickshank
- Move from
make_templatetorender_funcin jinja and dbt #4942 @alanmcruickshank - Streamline imports to reduce initial load times #4917 #5020 @alanmcruickshank
- More mypy strict #5019 @WittierDinosaur
- Simple API config and examples #5018 @alanmcruickshank
- Fix some new linting issues #5021 @alanmcruickshank
- A step towards mypy strict #5014 @WittierDinosaur
- Materialize: Make RETURNING a reserved keyword #5017 @bobbyiliev
- Config from string and load default_config as resource #5012 @alanmcruickshank
- Documentation for the test suite (#2180) #5011 @alanmcruickshank
- Add support to oracle's listagg function #4999 @joaostorrer
- Assorted typehints #5013 @alanmcruickshank
- Refactor: Extract noqa methods and tests. #5010 @alanmcruickshank
- AM06 to ignore aggregate ORDER BY clauses #5008 @tunetheweb
- Bugfix: Treat Function name properly in grants #5006 @WittierDinosaur
- Redshift: Add Qualify Clause #5002 @WittierDinosaur
- Clickhouse Dialect - Support Dollar Quoted Literals #5003 @kaiyannameighu
New Contributors
- @kaiyannameighu made their first contribution in #5003
- @joaostorrer made their first contribution in #4999
- @aglebov made their first contribution in #5026
- @josef-v made their first contribution in #5007
[2.1.4] - 2023-07-25
Highlights
This release brings some meaningful performance improvements to the parsing of complex SQL statements. In files with deeply nested expressions, we have seen up to a 50% reduction on time spent in the parsing phase. These changes are all internal optimisations and have minimal implications for the parser. In a few isolated cases they did highlight inconsistencies in the parsing of literals and so if your use case relies on the specific structure of literal and expression parsing you may find some small differences in how some expressions are parsed.
Additionally this release brings new validation steps to configuration. Layout configuration is now validated on load (and so users with invalid layout configurations may see some of these being caught now) and inline configuration statements in files are also now validated for both their layout rules and for any removed or deprecated settings.
On top of both we've seen dialect improvements to Databricks, PostgreSQL, BigQuery, Snowflake & Athena.
What’s Changed
- Databricks set time zone #5000 @greg-finley
- Terminator inheritance #4981 @alanmcruickshank
- Reduce copying in the parse phase #4988 @alanmcruickshank
- Validate layout configs #4578 #4997 @alanmcruickshank
- Fix handling of keywords for roles in ALTER ROLE statement #4994 @anzelpwj
- BigQuery: fixes parse error on some literals with data type and quoted #4992 @yoichi
- Correct Snowflake
CROSS JOINsyntax #4996 @tunetheweb - Remove broken 'fork me' banner from docs #4989 @greg-finley
- feat: support athena optional WITH ORDINALITY post UNNEST function #4991 @reata
[2.1.3] - 2023-07-19
Highlights
This release is a fairly standard incremental release. Highlights include bugfixes
to RF05 and dialect improvements to Snowflake, Teradata, MySQL, TSQL, SparkSQL & Postgres.
Internally, the last few weeks have brought several improvements to developer tooling.
We've also moved over to GitHub sponsorships - so if you previously used the old flattr link, you can find our new profile page at https://github.com/sponsors/sqlfluff.
What’s Changed
- Add the which dbt flag to DbtConfigArgs with default as "compile" #4982 @moreaupascal56
- feat: support tsql COPY INTO #4985 @reata
- fix: sparksql lateral view parse tree for multiple column alias #4980 @reata
- Revert "Ignore click mypy issues" #4967 @greg-finley
- Snowflake: Parse column named cross #4975 @greg-finley
- Snowflake: Group by all #4976 @greg-finley
- Update funding yaml to use github sponsors #4973 @alanmcruickshank
- Added DEL keyword #4962 @dflem97
- Remove mypy ignores #4972 @greg-finley
- Allow running one rule test locally #4963 @greg-finley
- Postgres support underscore array data type syntax #4959 @greg-finley
- Bump issue-labeler #4958 @greg-finley
- Standardize test fixture names #4955 @greg-finley
- RF05 BigQuery empty identifier bug #4953 @keitherskine
- New GitHub issue labeler library #4952 @greg-finley
- Ignore click mypy issues #4954 @greg-finley
- MySQL: Rename index #4950 @greg-finley
- Adding support to ALTER TABLE with RENAME COLUMN on MySQL dialect #4948 @jrballot
New Contributors
- @jrballot made their first contribution in #4948
- @keitherskine made their first contribution in #4953
- @reata made their first contribution in #4980
[2.1.2] - 2023-07-03
Highlights
This release resolves compatibility issues with a set of dbt-core versions.
dbt-core1.5.2 onwards is now properly supported.- support for
dbt-core1.1 to 1.4 has now been re-enabled after support had to be abandoned a few releases ago.
NOTE: We cannot guarantee that SQLFluff will always continue to remain
compatible with all dbt versions, particularly as the folks at dbt-labs
have often backported breaking changes to their internal APIs to previous
versions of dbt-core. This release does at least bring more extensive
internal testing to catch when this does occur to allow our community
to react.
This release fixes also resolves a potential security issue for when
using external libraries (and the library_path config setting),
and also contains various dialect improvements.
What’s Changed
- docs(templater): Add documentation for
SQLFLUFF_JINJA_FILTERS#4932 @dmohns - Re-enable dbt 1.1 & 1.2 #4944 @alanmcruickshank
- Re-enable dbt 1.4 & 1.3 #4941 @alanmcruickshank
- Fix compatibility with dbt 1.5.2+ #4939 @alanmcruickshank
- Security option for library path #4925 @alanmcruickshank
- Remove extra code escapes from release notes docs #4921 @tunetheweb
- Postgres frame_clause quoted interval #4915 @greg-finley
- Snowflake: CREATE TAG #4914 @greg-finley
- TSQL: support for
DROP EXTERNAL TABLE#4919 @keen85 - fix(dialect-clickhouse): Support create database #4620 @germainlefebvre4
- Snowflake: Actualize the CreateProcedureStatementSegment and CreateFunctionStatementSegment #4908 @moreaupascal56
- Oracle: Add support for
$and#in identifier #4903 @ulixius9 - docs(templater): Refactor templater configuration docs #4835 @dmohns
- Handle brackets in from clause with joins #4890 @ulixius9
- Postgres: Add support for dollar literal & mark collation as non-reserved #4883 @ulixius9
- MySQL: ON UPDATE NOW #4898 @greg-finley
- Support ROLLUP/CUBE in AM06 #4892 @tunetheweb
[2.1.1] - 2023-05-25
Highlights
This releases fixes a compatibility issue with the latest version of dbt. It also ships various dialect improvements.
What’s Changed
- profiles dir env var or default #4886 @JasonGluck
- Bigquery: Allow empty
structinTO_JSON#4879 @dimitris-flyr - Set type of ARRAY function for BigQuery #4880 @tunetheweb
- Full athena SHOW coverage #4876 @dogversioning
- Sparksql add star support in multiparameter functions #4874 @spex66
- Oracle create view with EDITIONING & FORCE #4872 @ulixius9
- Fixes pip installation link on Getting Started #4867 @segoldma
- Athena: add "weird" test cases for
group by#4869 @KulykDmytro - Athena: add support for
CUBEROLLUPGROUPING SETS#4862 @KulykDmytro - Add show tables/views to athena #4854 @dogversioning
- Adding support for NOCOPY and INSTANT algorithm on CREATE INDEX on MySQL dialect #4865 @wfelipew
- Add link to Trino keywords (Athena v3) #4858 @KulykDmytro
- TSQL: Create Role Authorization #4852 @greg-finley
- TSQL: DEADLOCK_PRIORITY #4853 @greg-finley
- fix(dialect-clickhouse): Support SYSTEM queries #4625 @germainlefebvre4
- Fix #4807: LT02 & LT12 issues with empty files. #4834 @alanmcruickshank
- Sqlite: COLLATE column constraint #4845 @greg-finley
- Hive: Support REGEXP and IREGEXP #4846 @greg-finley
New Contributors
- @dogversioning made their first contribution in #4854
- @segoldma made their first contribution in #4867
- @spex66 made their first contribution in #4874
- @dimitris-flyr made their first contribution in #4879
- @JasonGluck made their first contribution in #4886
[2.1.0] - 2023-05-03
Highlights
This release brings support for dbt 1.5+. Some internals of dbt mean that SQFluff versions prior to this release may experience errors with dbt versions post 1.5. In addition to that there are some dialect and templating improvements bundled too:
- Support for custom Jinja filters.
- An additional configurable indent behaviour within
CASE WHENclauses. - Additional support for bracket quoted literals in TSQL and RF06.
- Dialect improvements to Snowflake, Hive, Redshift, Postgres, Clickhouse, Oracle and SQLite
What’s Changed
- Add support for Jinja filters #4810 @dmohns
- Postgres: Allow INSERT RETURNING #4820 @WittierDinosaur
- SQLite: Support partial index #4833 @WittierDinosaur
- Make SQLFluff compatible with DBT 1.5 #4828 @WittierDinosaur
- Snowflake dialect: Add support for comment clause in the create warehouse statement #4823 @moreaupascal56
- fix(dialect-clickhouse): Support DROP statements #4821 @germainlefebvre4
- Hive: INSERT INTO without TABLE keyword #4819 @greg-finley
- Fix: Small typo in error message #4814 @JavierMonton
- Redshift: Support with no schema binding #4813 @WittierDinosaur
- Detect tsql square bracket quotes for RF06 #4724 #4781 @daviewales
- Apply implicit indents to
WHENblocks and introduceindented_then_contents#4755 @borchero - Oracle: Update Drop Behaviour #4803 @WittierDinosaur
- Oracle: Update bare functions #4804 @WittierDinosaur
New Contributors
- @daviewales made their first contribution in #4781
[2.0.7] - 2023-04-20
Highlights
This is a bugfix release to resolve two regressions included in 2.0.6 related to implicit indents. This also includes a bugfix for config file on osx, contributed by first time contributor @jpuris 🎉.
What’s Changed
- Fix regression in implicit indents #4798 @alanmcruickshank
- Fix bug with brackets and implicit indents #4797 @alanmcruickshank
- fix: correct macos/osx config file location #4795 @jpuris
New Contributors
[2.0.6] - 2023-04-19
Highlights
- Introduction of a
--quietoption for the CLI for situations where less output is useful. - When using the
--forceoption is used forsqlfluff fixeach file is fixed during the linting process rather than at the end. - Bugfixes to comment and templated section indentation.
- Performance improvements to parsing.
- Bugfix to macros triggering LT01.
- Renaming
layout.end-of-filetolayout.end_of_filein line with other rules. - Dialect improvements to SparkSQL, BigQuery, Hive & Snowflake.
What’s Changed
- Snowflake: Support Temporary View #4789 @WittierDinosaur
- Inroduce
SAFEprefix segment #4773 @dmohns - Fix #4660: Better handling of empty files. #4780 @alanmcruickshank
- Fix #3538: (Fix files as we go) #4777 @alanmcruickshank
- Fix #2855: (Tech debt: check consistency in TemplatedFile init) #4776 @alanmcruickshank
- Add a --quiet option for fix #4764 @alanmcruickshank
- Fix #4603 indent after Jinja 'do' directive #4778 @fredriv
- Snowflake Execute Task with Schema #4771 @Thashin
- SQLite: Support CreateTrigger #4767 @WittierDinosaur
- Fix #2865 (AL05 exception for Redshift Semi-structured) #4775 @alanmcruickshank
- Fix #4540: Untaken indents evaluation order. #4768 @alanmcruickshank
- Use the new CollationReferenceSegment everywhere #4770 @james-johnston-thumbtack
- SQLite: Fix multiple parse issues in Expression_A_Grammar #4769 @james-johnston-thumbtack
- SQLite: Remove refs to RESPECT and QUALIFY #4765 @WittierDinosaur
- SQLite: Support STRICT #4766 @WittierDinosaur
- Support hive set syntax #4763 @alanmcruickshank
- Fix #4582: Comments after end of line #4760 @alanmcruickshank
- Allow comment match with preceding line #4758 @alanmcruickshank
- Remove the majority of greedy matchers #4761 @WittierDinosaur
- Fix #4745: (max() error in reindent) #4752 @alanmcruickshank
- Fix issue with macros triggering LT01 #4757 @alanmcruickshank
- end-of-file > end_of_file #4753 @alanmcruickshank
[2.0.5] - 2023-04-14
Highlights
This is a relatively swift bugfix to refine some of the changes made to
widow function indentation in 2.0.4. In addition there are two dialect
refinements also made since that release.
What’s Changed
- Refactor PG segments to reuse new common segments #4726 @james-johnston-thumbtack
- Recognize quoted data types #4747 @james-johnston-thumbtack
[2.0.4] - 2023-04-14
Highlights
This is primarily a bugfix and dialect release:
- Several bugfixes related to templating and indentation, in particular some improvements to the indentation of aliases and window functions.
- Performance improvements to the parser.
- The
--persist-timingoption is now also available onsqlfluff fix. - A refresh to getting started and rule documentation.
- Dialect improvements to PostgreSQL, Athena, SparkSQL, MySQL & Snowflake.
Thanks also to @james-johnston-thumbtack and @Thashin who made their first contributions in this release. In particular, @james-johnston-thumbtack made twenty one contributions in their first month! 🎉🎉🎉
What’s Changed
- SparkSQL: Improvements to lateral view, hints, sort by #4731 @bmorck
- Add ExpressionSegment to CREATE TABLE ... DEFAULT / Fix multiple parse issues in Expression_A_Grammar #4717 @james-johnston-thumbtack
- Add support for the PG VACUUM statement #4742 @james-johnston-thumbtack
- Simplify and fix PG array accessor segment & support expressions #4748 @james-johnston-thumbtack
- SparkSQL: Allow for any ordering of create table clauses #4721 @bmorck
- Suggested started config file #4702 @alanmcruickshank
- Indents on window functions #4560 @alanmcruickshank
- SparkSQL: Fix Group By Clause #4732 @bmorck
- Improve support for EXCLUDE table constraints in PG #4725 @james-johnston-thumbtack
- Add support for dropping multiple indexes in PG #4737 @james-johnston-thumbtack
- Recognize "on" value and integers for PG SET statement #4740 @james-johnston-thumbtack
- Improve interval expressions on MySQL #4746 @james-johnston-thumbtack
- Keep out zero length keywords #4723 @james-johnston-thumbtack
- Add PG support for CREATE SCHEMA AUTHORIZATION #4735 @james-johnston-thumbtack
- Add support for dropping multiple views with PostgreSQL #4736 @james-johnston-thumbtack
- Add CHAR VARYING data type for PG #4738 @james-johnston-thumbtack
- fix(athena): map type matching failed, array type only contains a datatype #4739 @timcosta
- Allow DML queries to be selectable in CTEs on PG #4741 @james-johnston-thumbtack
- Add the CREATE/DROP CAST statements to ANSI and PG #4744 @james-johnston-thumbtack
- Add support for PG SET ROLE / RESET ROLE #4734 @james-johnston-thumbtack
- Support Spark Iceberg DDL #4690 @bmorck
- Fix #4680 #4707 @alanmcruickshank
- Indent Aliases #4706 @alanmcruickshank
- SparkSQL: Improve window frame bounds #4722 @bmorck
- Add support for PG CREATE/ALTER/DROP PUBLICATION stmts #4716 @james-johnston-thumbtack
- SparkSQL: Create external table support #4692 @bmorck
- SparkSQL: Fix file literal lexing #4718 @bmorck
- Add PG DROP/REASSIGN OWNED statements #4720 @james-johnston-thumbtack
- SparkSQL: Add distinct to comparison operator #4719 @bmorck
- Rethink Rule Docs #4695 @alanmcruickshank
- Performance: Reduce calls to _prune_options #4705 @alanmcruickshank
- Snowflake: Add ReferencedVariableNameSegment to sample function #4712 @WittierDinosaur
- Mark AM02 as fix compatible #4714 @yoichi
- Fix LT01 spacing check in templated areas #4698 @james-johnston-thumbtack
- Don't do newline conversion on write #4703 @alanmcruickshank
- MySQL: CREATE/ALTER VIEW may take UNION #4713 @yoichi
- Preserve zero-length template segments #4708 @james-johnston-thumbtack
- CV06: don't flag files that don't have code #4709 @james-johnston-thumbtack
- Add a no-output option #4704 @alanmcruickshank
- Jinja templater: treat "import" and "from" as templated #4696 @james-johnston-thumbtack
- Capitalization rules ignore templated code only if configured to #4697 @james-johnston-thumbtack
- Update getting started docs #4700 @alanmcruickshank
- Add a default for config_keywords and remove noisy error. #4701 @alanmcruickshank
- Snowflake Select System Functions #4687 @Thashin
- SparkSQL: Add using and options clause to create view statement #4691 @bmorck
- MySQL: Add RETURN Statement #4693 @yoichi
- Safety valve for fixes in CV03 #4685 @alanmcruickshank
- Allow persist timing on
fixtoo. #4679 @alanmcruickshank - fix{dialect-snowflake}:Alter Table Column Set/Unset Tag #4682 @Thashin
- fix{dialect-snowflake}:Execute Task #4683 @Thashin
- Make version number an argument not an option in release script. #4677 @alanmcruickshank
New Contributors
- @Thashin made their first contribution in #4683
- @james-johnston-thumbtack made their first contribution in #4697
[2.0.3] - 2023-04-05
Highlights
This is primarily a bugfix and dialect release:
- Several bugfixes related to templating and indentation.
- Configurable indentation before
THENinCASEstatements (see #4598). - Performance improvements to
TypedParser,LT03<04. - Rule timings now appear in the
--persist-timingoption for deeper performance understanding. - The introduction of a Greenplum dialect.
- Dialect improvements to TSQL, Athena, Snowflake, MySQL, SparkSQL BigQuery, Databricks, Clickhouse & Postgres.
We also saw a huge number of first time contributors with 9 contributing in this release 🎉🏆🎉.
What’s Changed
- Better error message for missing keywords #4676 @tunetheweb
- Add performance shortcuts to LT03 & LT04 #4672 @alanmcruickshank
- Clickhouse: Add support for [LEFT] ARRAY JOIN #4618 @simpl1g
- Postgres - allow untyped OVERLAPS clauses #4674 @tunetheweb
- Mark
is_alias_requiredas a private class so it doesn't appear in docs #4673 @tunetheweb - Fix bug in templated with clauses LT07 #4671 @alanmcruickshank
- TSQL:
OPENJSON()#4652 @keen85 - fix(RF06/L059): allows configuring prefer_quoted_keywords to deconflict with L029 #4396 @timcosta
- TSQL:
Create External Table#4642 @aly76 - Consistent indentation in
MERGEINSERTclause #4666 @dmohns - BigQuery: Fix null assignment in options segment #4669 @greg-finley
- BigQuery: Delete table reference #4668 @greg-finley
- TSQL:
CREATE EXTERNAL FILE FORMAT#4647 @keen85 - Remove TIME as reserved keyword in SparkSQL #4662 @bmorck
- Start of the Greenplum dialect implementation #4661 @JackWolverson
- Enable configuring whether to require indent before THEN #4598 @fredriv
- Sequence Meta Handling #4622 @alanmcruickshank
- Add support for non-quoted file paths in SparkSQL #4650 @bmorck
- Remove three RegexParsers #4658 @alanmcruickshank
- Make parse test readout more helpful #4657 @alanmcruickshank
- TSQL: support for
sqlcmdcommands:rand:setvar#4653 @keen85 - Update README with Databricks note #4632 @liamperritt
- Athena: Fix parsing error with aliases starting with underscore #4636 @maiarareinaldo
- Snowflake: Stop ever-increasing indent in CREATE USER #4638 @roman-ef
- TSQL:
PERIOD FOR SYSTEM_TIME(temporal tables) #4654 @keen85 - MySQL: SelectStatementSegment in CREATE/ALTER VIEW may be bracketed #4655 @yoichi
- TSQL:
CREATE EXTERNAL DATA SOURCE#4634 @keen85 - Safety valve on source fixes #4640 @alanmcruickshank
- Add SparkSQL support for LONG primitive type #4639 @bmorck
- Fix PIVOT clauses for BigQuery and SparkSQL #4630 @tunetheweb
- Correct BigQuery WINDOW parsing #4629 @tunetheweb
- Add Databricks dialect support for Unity Catalog #4568 @liamperritt
- .simple() matching for TypedMatcher #4612 @alanmcruickshank
- --bench output with rule timings #4601 @alanmcruickshank
- MySQL: Unnamed constraints #4616 @greg-finley
- TSQL: Create database scoped credential #4615 @greg-finley
- fix(dialect-clickhouse): Add materialized view statement #4605 @germainlefebvre4
- Nicer formatted dbt errors #4606 @alanmcruickshank
- add parse lambda function Clickhouse #4611 @konnectr
- Support
WITH ORDINALITYclauses in Postgres #4599 @tunetheweb
New Contributors
- @germainlefebvre4 made their first contribution in #4605
- @liamperritt made their first contribution in #4568
- @bmorck made their first contribution in #4639
- @keen85 made their first contribution in #4634
- @roman-ef made their first contribution in #4638
- @maiarareinaldo made their first contribution in #4636
- @fredriv made their first contribution in #4598
- @aly76 made their first contribution in #4642
- @simpl1g made their first contribution in #4618
[2.0.2] - 2023-03-23
Highlights
This is primarily a bugfix release. Most notably this solves some of the
issues introduced in 2.0.1 around spacing within datatypes. Expressions
like 1.0::double precision should now be spaced correctly.
Beyond that, this contains a selection of smaller bugfixes and dialect improvements. Even for a relatively small release we saw three new contributors (thanks @aurany, @JackWolverson & @mikaeltw 🎉).
The one new feature (as such) is being able to now configure LT05
(aka layout.long_lines) to optionally move trailing comments after
the line they are found on, rather than the default behaviour of moving
them up and before. Users can enable this with the trailing_comments
configuration setting in the indentation section.
This release also contains some performance optimisations in the parser, especially on queries with heavily nested expressions. There will be more to come in this space, but we hope this leads to a better experience for many users. 🚀
What’s Changed
- Parse Caching #4576 @alanmcruickshank
- Data type spacing #4592 @alanmcruickshank
- MySQL: allow quoted literal in alias name #4591 @yoichi
- Make implicit indents visible in the parse tree #4584 @alanmcruickshank
- Fix #4559: TSQL implicit indents on WHERE #4583 @alanmcruickshank
- Added keywords to DB2 dialect from IBM docs #4575 @aurany
- Remove matches_target_tuples (#3873) #4561 @alanmcruickshank
- Use terminators in BaseExpression #4577 @alanmcruickshank
- Address #1630: Optionally move comments after long line #4558 @alanmcruickshank
- Added schema to set statement #4580 @JackWolverson
- Refactor lint_line_length and fix comma bug #4564 @alanmcruickshank
- Fix untaken indent bug #4562 @alanmcruickshank
- SQLite: Fix SELECT LIMIT #4566 @greg-finley
- Fix #4453: Snowflake semi-stuctured casts in CV11 #4571 @alanmcruickshank
- Name of LT07 #4557 @alanmcruickshank
- Patch fetch and over #4555 @mikaeltw
New Contributors
- @mikaeltw made their first contribution in #4555
- @JackWolverson made their first contribution in #4580
- @aurany made their first contribution in #4575
[2.0.1] - 2023-03-17
Highlights
This is mostly a bugfix release addressing some of the issues from the recent 2.0 release. Notable fixes are:
- Spacing for (as applied by
LT01) for datatypes, hyphenated identifiers and casting operators. - Several bugs in the indentation routines (
LT02), in particular with implicit indents. - Fixing a conflict between
LT09andLT02, by only limitingLT09to bringing targets onto a single line if there is only one select target and that it contains no newlines. - Supporting arrays, and the new rules configuration more effectively in
pyproject.toml. - Configuring dialects on a file by file basis using inline comments now works.
This release also brings one small new feature in allowing additional flags to
be passed to SQLFluff when called as a pre-commit hook.
Thanks especially to @JavierMonton and @LauraRichter who made their first contributions to the project as part of this release! 🎉🏆
What’s Changed
- Add support for arrays in TOML configuration #4387 @AidanHarveyNelson
- Rethink test segregation in CI #4547 @alanmcruickshank
- Fix #4515 and add more test cases #4525 @alanmcruickshank
- Add additional flags to
sqlfluffinvocations in pre-commit hooks #4546 @borchero - Resolve #4484 (issues with indented_joins indents) #4544 @alanmcruickshank
- Per file dialect selection fix #4518 @LauraRichter
- MySQL: Add CREATE INDEX #4538 @yoichi
- Resolve implicit indent issues when catching negative indents #4543 @alanmcruickshank
- Github Action Deprecations #4545 @alanmcruickshank
- LT09 and multiline select targets #4529 @alanmcruickshank
- Remove Codecov from CI #4535 @alanmcruickshank
- Bigquery hyphentated identifiers #4530 @alanmcruickshank
- Attempt in-house coverage #4532 @alanmcruickshank
- Postgres datatype spacing issues #4528 @alanmcruickshank
- Support new rules config in toml files. #4526 @alanmcruickshank
- Resolve #1146 (log propagation) #4513 @alanmcruickshank
- Snowflake: Optional quotes for
create userstatement #4514 @JavierMonton
New Contributors
- @JavierMonton made their first contribution in #4514
- @LauraRichter made their first contribution in #4518
[2.0.0] - 2023-03-13
Highlights
Upgrading to 2.0 brings several important breaking changes:
- All bundled rules have been recoded, both from generic
L00Xformats into groups within similar codes (e.g. an aliasing group with codes of the formatAL0X), but also given names to allow much clearer referencing (e.g.aliasing.column). - Configuring rules now uses the rule name rather than the rule code to specify the section. Any unrecognised references in config files (whether they are references which do match existing rules by code or alias, or whether the match no rules at all) will raise warnings at runtime.
- A complete re-write of layout and whitespace handling rules (see
layout), and with
that a change in how layout is configured (see
configuring layout)
and the combination of some rules that were previously separate. One
example of this is that the legacy rules
L001,L005,L006,L008,L023,L024,L039,L048&L071have been combined simply into LT01. - Dropping support for dbt versions before
1.1.
To help users upgrade to 2.0, we've put together a recommended process as part of our release notes.
Beyond the breaking changes, this release brings a load of additional changes:
- Introduces the the
sqlfluff formatCLI command (a lasqlfmtorblack) to auto-format sql files using a known set of fairly safe rules. - Databricks as a distinct new dialect (rather than as previously an alias
for
sparksql). - Performance improvements in our parsing engine.
- Dialect improvements to almost all of them.
As a new major release, especially with significant rewrites of large
portions of the codebase, we recommend using compatible release
specifiers in your dependencies (i.e. sqlfluff~=2.0.0) so that you
can automatically take advantage of any bugfix releases in the coming
weeks. The alpha releases of 2.0.0 have been tested on a range of large
projects, but we know that the range of use cases "in the wild" is
very diverse. If you do experience issues, please post them
on GitHub
in the usual manner.
Finally thanks to everyone who has worked on this release, especially @konnectr, @ValentinCrr, @FabianScheidt, @dflem97, @timcosta, @AidanHarveyNelson, @joar, @jmpfar, @jared-rimmer, @vesatoivonen, @briankravec, @saintamh, @tdurieux, @baa-ableton, & @WillAyd who made their first contributions during the development of 2.0.0. Thanks for your contributions, and especially your patience in the slightly slower release of your efforts into the wild. 🙏🎉
What’s Changed
- Revise templating and lexing of calls. #4506 @alanmcruickshank
- Struct Access Spacing #4512 @alanmcruickshank
- Array and Struct Spacing #4511 @alanmcruickshank
- Add a deprecation warning for removed config option. #4509 @alanmcruickshank
- Bigquery spacing (#4508) @alanmcruickshank
- Fix #4433 (more untaken positive indents) #4499 @alanmcruickshank
- Fix parse error on double parentheses #4504 @yoichi
- 2.0.0 Migration Guide #4498 @alanmcruickshank
- Handle missing aliases and align constraints better #4493 @alanmcruickshank
- TSQL: Add support For Clause #4501 @AidanHarveyNelson
- Allow Jinja rule to loop safely #4495 @alanmcruickshank
- Trigger CI tests for merge groups #4503 @alanmcruickshank
- Update Readme and Contributing #4502 @alanmcruickshank
- Update layout docs #4500 @alanmcruickshank
- Bug in operator precedence #4497 @alanmcruickshank
- BigQuery: correct query syntax for single column
UNPIVOTclauses #4494 @imrehg - Fix #4485 #4491 @alanmcruickshank
- Update reserved keywords in Athena language #4490 @ValentinCrr
- Clickhouse support all join types #4488 @konnectr
- Snowflake semi-structured spacing #4487 @alanmcruickshank
- Prep version 2.0.0a6 #4476 @github-actions
- Fix #4367 #4479 @alanmcruickshank
- Teradata: Improve COLLECT STATS parsing #4478 @dflem97
- Add a sqlfluff format CLI command #4473 @alanmcruickshank
- Recode and disable L031 -> AL07 #4471 @alanmcruickshank
- Named Config (part 2) #4470 @alanmcruickshank
- Rule config lookup improvements & config warnings #4465 @alanmcruickshank
- Recode L050 #4468 @alanmcruickshank
- Implicit indent fixes #4467 #4469 @alanmcruickshank
- ANSI: Add IfExistsGrammar to DropTrigger #4466 @WittierDinosaur
- Rules Reorg Mopup #4462 @alanmcruickshank
- Layout Rules Recode (part 2) #4456 @alanmcruickshank
- fix(athena): resolve errors parsing around maps, structs, and arrays #4391 @timcosta
- Layout Rules Recode (part 1) #4432 @alanmcruickshank
- TSQL: EXEC string literal #4458 @jpers36
- Teradata: Added SET QUERY_BAND statement #4459 @dflem97
- Teradata: Added TOP select clause modifier #4461 @dflem97
- Teradata: Addition of comparison operator extensions #4451 @dflem97
- Add extensions and plugin section to the README.md #4454 @jared-rimmer
- Convention rules bundle #4448 @alanmcruickshank
- References rule bundle #4446 @alanmcruickshank
- Structure and Ambiguous rule bundles #4444 @alanmcruickshank
- TSQL: Bare functions #4439 @jpers36
- Pull dbt CI tests forward to 1.1 and 1.4 #4442 @WittierDinosaur
- Teradata: Added "AND STATS" options when creating table #4440 @dflem97
- Add Databricks as a distinct dialect #4438 @WittierDinosaur
- Remove importlib deprecated methods #4437 @alanmcruickshank
- SQLite: Support PRAGMA statements #4431 @WittierDinosaur
- Proposed graceful handling of noqa by L016 (#4248) #4424 @alanmcruickshank
- DuckDb: Allow quoted literals as identifiers #4410 @WittierDinosaur
- SQLite Refactor to reduce statement and keyword scope #4409 @WittierDinosaur
- L046 and L056 recode #4430 @alanmcruickshank
- Recode Aliasing Rules #4427 @alanmcruickshank
- Adjust MySQL dialect to support combination of not-null, default and … #4426 @FabianScheidt
- Revert some changes to tox #4428 @alanmcruickshank
- Migrate capitalisation rules to plugin and recode #4413 @alanmcruickshank
- Prep version 2.0.0a5 #4419 @github-actions
- Handle long lines without trailing newlines gracefully (#4386) #4423 @alanmcruickshank
- Resolve #4184 (index error in L007) #4422 @alanmcruickshank
- Handle untaken positive indents with taken negative pair. #4420 @alanmcruickshank
- Postgres: AS MATERIALIZED support #4417 @saintamh
- Align warnings config with example shown #4421 @briankravec
- BigQuery: parse "AS description" part of assert expressions #4418 @yoichi
- Deprecate doc decorators (replace with metaclass) #4415 @alanmcruickshank
- Enable noqa using aliases and groups #4414 @alanmcruickshank
- Add rule names to CLI outputs #4400 @alanmcruickshank
- Postgres: Remove execution keyword inherited from ANSI #4411 @WittierDinosaur
- Rule names, aliases and more complicated selection. #4399 @alanmcruickshank
- Postgres: Support Recursive View #4412 @WittierDinosaur
- T-SQL: Implement BULK INSERT statement #4381 @borchero
- L062: Add match_source (#4172) #4335 @vesatoivonen
- TSQL: Add SET to ALTER TABLE #4407 @jared-rimmer
- Snowflake: ALTER STORAGE INTEGRATION segment #4406 @jared-rimmer
- Fix incorrect link to pre-commit docs #4405 @pdebelak
- Add Snowflake dialect ALTER ROLE segment #4403 @jared-rimmer
- Improving Postgres create index statement #4356 @jmpfar
- Resolve #4291: Comments forcing unexpected indents. #4384 @alanmcruickshank
- Resolve #4294: Comments affecting indentation #4337 @alanmcruickshank
- Resolve #4292: Window function long line fixes #4383 @alanmcruickshank
- TSQL: ALTER INDEX #4364 @AidanHarveyNelson
- Added Varying Keyword to allowed data type segments #4375 @AidanHarveyNelson
- Add ruff linter #4372 @greg-finley
- Fix postgres column constraint default syntax #4379 @pdebelak
- Allow function names to have a leading underscore #4377 @gavin-tsang
- TSQL: Merge Hints #4354 @AidanHarveyNelson
- TSQL: Temporal Table #4358 @AidanHarveyNelson
- TSQL: ALTER TABLE #4369 @AidanHarveyNelson
- Bugfix: Duckdb SELECT * #4365 @WittierDinosaur
- Postgres: TABLESAMPLE query #4357 @greg-finley
- reindent refactor #4338 @alanmcruickshank
- Snowflake: INSERT INTO #4363 @AidanHarveyNelson
- Docs: correct toml syntax of pyproject.toml file config example #4361 @imrehg
- Allowed Naked Identifiers #4359 @AidanHarveyNelson
- TSQL: TABLESAMPLE #4353 @AidanHarveyNelson
- Tsql: Function Parameters #4352 @AidanHarveyNelson
- Postgres: Storage parameters #4350 @AidanHarveyNelson
- TSQL: Bare Function Set #4351 @AidanHarveyNelson
- Postgres: View options #4340 @AidanHarveyNelson
- BigQuery: SELECT DISTINCT AS STRUCT #4341 @joar
- Snowflake: Fix Alter Warehouse #4344 @AidanHarveyNelson
- Parser: Optimise lookahead_match #4327 @WittierDinosaur
- Add support for dbt test macros #4319 @pdebelak
- Bracket complex expressions before applying :: operator in Rule L067 #4326 @pdebelak
- Prep version 2.0.0a4 #4322 @github-actions
- BigQuery: Alter table alter column #4316 @greg-finley
- Handle renamed dbt exceptions #4317 @greg-finley
- Parser: Fix early exit for simple matchers #4305 @WittierDinosaur
- MySQL: Add CREATE DATABASE and ALTER DATABASE #4307 @yoichi
- BigQuery: Add ALTER VIEW #4306 @yoichi
- toml: only install
tomldependency if < Python 3.11 (otherwise use builtintomllib) #4303 @kevinmarsh - Fix #4024 example plugin unit tests import #4302 @matthieucan
- Prep version 2.0.0a3 #4290 @github-actions
- Move ISSUE from Snwoflake reserved keywords to unreserved ones #4279 @KaoutherElhamdi
- Due to performance and other issues, revert the osmosis implementation of the templater for now #4273 @barrywhart
- Simplify lexing #4289 @alanmcruickshank
- Fix #4255 (Fix exception on mixed indent description) #4288 @alanmcruickshank
- Fix #4253 (incorrect trigger of L006 around placeholders) #4287 @alanmcruickshank
- Fix #4249 (TSQL block comment indents) #4286 @alanmcruickshank
- Fix #4252 (Resolve multiple sensible indents) #4285 @alanmcruickshank
- Parser Performance: Cache segment string repr to reduce function calls #4278 @WittierDinosaur
- Snowflake: GRANT SUPPORT CASES #4283 @WittierDinosaur
- Dialect: duckdb #4284 @WittierDinosaur
- Snowflake: Add variable pattern to CopyIntoTable #4275 @WittierDinosaur
- Postgres: Non-reserved keyword bugfix #4277 @WittierDinosaur
- Hive: Add Table constraints DISABLE VALIDATE #4281 @WittierDinosaur
- Snowflake: Add Python and Java UDF support #4280 @WittierDinosaur
- SparkSQL: Support DIV binary operator #4282 @WittierDinosaur
- BigQuery: Add ALTER TABLE #4272 @yoichi
- Snowflake: Update bare functions #4276 @WittierDinosaur
- Improve Dockerfile to reduce image size #4262 @tdurieux
- Prep version 2.0.0a2 #4247 @github-actions
- Push indents to after comments #4239 @alanmcruickshank
- Templated fix improvements and indentation #4245 @alanmcruickshank
- Fix block comment indent fixes #4224 #4240 @alanmcruickshank
- Fix for #4222 #4236 @alanmcruickshank
- Snowflake: Allow multiple unpivot #4242 @greg-finley
- postgres: add row-level locks to SELECT statements #4209 @Yiwen-Gao
- Add more parsing logic for db2 #4206 @NelsonTorres
- Include the filename in critical exceptions #4225 @alanmcruickshank
- Update Readme Badges #4219 @alanmcruickshank
- diff-quality: Handle the case where there are no files to check #4220 @barrywhart
- Prep version 2.0.0a1 #4203 @github-actions
- Fixed False Positive for L037 #4198 @WillAyd
- Fix #4215 #4217 @alanmcruickshank
- don't consider templated whitespace #4213 @alanmcruickshank
- show fatal errors regardless #4214 @alanmcruickshank
- don't pickle the templater #4208 @alanmcruickshank
- MySQL: Support column character set and collation #4204 @yoichi
- Fix some issues with Docker Compose environment #4201 @barrywhart
- Implicit Indents #4054 @alanmcruickshank
- Tweak Coveralls settings #4199 @barrywhart
- In addition to Codecov, also upload to Coveralls #4197 @barrywhart
- Fix: create table default cast returns unparsable section #4192 @NelsonTorres
- Fix JSON parsing issue with diff-quality plugin #4190 @barrywhart
- Codecov migration #4195 @alanmcruickshank
- Stop adding trailing os.sep if ignore file is on the root of the file… #4182 @baa-ableton
- Port dbt-osmosis templater changes to SQLFluff #3976 @barrywhart
- Reflow 4: Long Lines #4067 @alanmcruickshank
- Fix comment bug on reindent #4179 @alanmcruickshank
- Reflow 3: Reindent #3942 @alanmcruickshank
New Contributors
- @konnectr made their first contribution in #4488
- @ValentinCrr made their first contribution in #4490
- @FabianScheidt made their first contribution in #4426
- @dflem97 made their first contribution in #4440
- @timcosta made their first contribution in #4391
- @AidanHarveyNelson made their first contribution in #4344
- @joar made their first contribution in #4341
- @jmpfar made their first contribution in #4356
- @jared-rimmer made their first contribution in #4403
- @vesatoivonen made their first contribution in #4335
- @briankravec made their first contribution in #4421
- @saintamh made their first contribution in #4417
- @tdurieux made their first contribution in #4262
- @baa-ableton made their first contribution in #4182
- @WillAyd made their first contribution in #4198
[2.0.0a6] - 2023-03-06
NOTE: This is effectively a release candidate for testing purposes. There are several new features here, and breaking changes to configuration. We welcome testing feedback from the community, and the intent is that following this release there will be no more major breaking changes in the before the 2.0.0 release.
Highlights
This is the sixth alpha release for 2.0.0, and effectively the first release candidate for 2.0.0. All the intended breaking changes for the upcoming release have now been made and only bugfixes and non breaking feature changes should happen between this release and the full release.
It contains:
- A reorganisation of rules. All rules have been recoded, and can now be referred to by their name, code, alias or group. The legacy code for the rule is included as an alias for each rule to support some backward compatibility.
- Configuration files (and inline configuration flags), should now use the name of the rule rather than the code. Any configuration files which reference using legacy rules (or reference unknown rules) should now display warnings.
- Introduces the the
sqlfluff formatCLI command (a lasqlfmtorblack) to auto-format sql files using a known set of fairly safe rules. - Databricks as a distinct new dialect (rather than as previously an alias
for
sparksql).
There are also numerous dialect improvements to ANSI, Athena, TSQL, Teradata, SQLite & MySQL.
What’s Changed
- Fix #4367 #4479 @alanmcruickshank
- Teradata: Improve COLLECT STATS parsing #4478 @dflem97
- Add a sqlfluff format CLI command #4473 @alanmcruickshank
- Recode and disable L031 -> AL07 #4471 @alanmcruickshank
- Named Config (part 2) #4470 @alanmcruickshank
- Rule config lookup improvements & config warnings #4465 @alanmcruickshank
- Recode L050 #4468 @alanmcruickshank
- Implicit indent fixes #4467 #4469 @alanmcruickshank
- ANSI: Add IfExistsGrammar to DropTrigger #4466 @WittierDinosaur
- Rules Reorg Mopup #4462 @alanmcruickshank
- Layout Rules Recode (part 2) #4456 @alanmcruickshank
- fix(athena): resolve errors parsing around maps, structs, and arrays #4391 @timcosta
- Layout Rules Recode (part 1) #4432 @alanmcruickshank
- TSQL: EXEC string literal #4458 @jpers36
- Teradata: Added SET QUERY_BAND statement #4459 @dflem97
- Teradata: Added TOP select clause modifier #4461 @dflem97
- Teradata: Addition of comparison operator extensions #4451 @dflem97
- Add extensions and plugin section to the README.md #4454 @jared-rimmer
- Convention rules bundle #4448 @alanmcruickshank
- References rule bundle #4446 @alanmcruickshank
- Structure and Ambiguous rule bundles #4444 @alanmcruickshank
- TSQL: Bare functions #4439 @jpers36
- Pull dbt CI tests forward to 1.1 and 1.4 #4442 @WittierDinosaur
- Teradata: Added "AND STATS" options when creating table #4440 @dflem97
- Add Databricks as a distinct dialect #4438 @WittierDinosaur
- Remove importlib deprecated methods #4437 @alanmcruickshank
- SQLite: Support PRAGMA statements #4431 @WittierDinosaur
- Proposed graceful handling of noqa by L016 (#4248) #4424 @alanmcruickshank
- DuckDb: Allow quoted literals as identifiers #4410 @WittierDinosaur
- SQLite Refactor to reduce statement and keyword scope #4409 @WittierDinosaur
- L046 and L056 recode #4430 @alanmcruickshank
- Recode Aliasing Rules #4427 @alanmcruickshank
- Adjust MySQL dialect to support combination of not-null, default and … #4426 @FabianScheidt
- Revert some changes to tox #4428 @alanmcruickshank
- Migrate capitalisation rules to plugin and recode #4413 @alanmcruickshank
New Contributors
- @FabianScheidt made their first contribution in #4426
- @dflem97 made their first contribution in #4440
- @timcosta made their first contribution in #4391
[2.0.0a5] - 2023-02-24
NOTE: This is an alpha release for testing purposes. There are several new features here, and breaking changes to configuration. We welcome testing feedback from the community, but know that this release may feel less polished than usual.
Highlights
This is the fifth alpha release for 2.0.0. It contains:
- Significant rework to rule naming and categorisation.
- Several performance improvements.
- Many dialect improvements to several dialects.
- Bugfixes to many of the issues raised in 2.0.0a4.
There will likely be more changes to rule classification before a full release of 2.0.0, so anticipate that configuration files may change slightly again in future alpha releases.
What’s Changed
- Handle long lines without trailing newlines gracefully (#4386) #4423 @alanmcruickshank
- Resolve #4184 (index error in L007) #4422 @alanmcruickshank
- Handle untaken positive indents with taken negative pair. #4420 @alanmcruickshank
- Postgres: AS MATERIALIZED support #4417 @saintamh
- Align warnings config with example shown #4421 @briankravec
- BigQuery: parse "AS description" part of assert expressions #4418 @yoichi
- Deprecate doc decorators (replace with metaclass) #4415 @alanmcruickshank
- Enable noqa using aliases and groups #4414 @alanmcruickshank
- Add rule names to CLI outputs #4400 @alanmcruickshank
- Postgres: Remove execution keyword inherited from ANSI #4411 @WittierDinosaur
- Rule names, aliases and more complicated selection. #4399 @alanmcruickshank
- Postgres: Support Recursive View #4412 @WittierDinosaur
- T-SQL: Implement BULK INSERT statement #4381 @borchero
- L062: Add match_source (#4172) #4335 @vesatoivonen
- TSQL: Add SET to ALTER TABLE #4407 @jared-rimmer
- Snowflake: ALTER STORAGE INTEGRATION segment #4406 @jared-rimmer
- Fix incorrect link to pre-commit docs #4405 @pdebelak
- Add Snowflake dialect ALTER ROLE segment #4403 @jared-rimmer
- Improving Postgres create index statement #4356 @jmpfar
- Resolve #4291: Comments forcing unexpected indents. #4384 @alanmcruickshank
- Resolve #4294: Comments affecting indentation #4337 @alanmcruickshank
- Resolve #4292: Window function long line fixes #4383 @alanmcruickshank
- TSQL: ALTER INDEX #4364 @AidanHarveyNelson
- Added Varying Keyword to allowed data type segments #4375 @AidanHarveyNelson
- Add ruff linter #4372 @greg-finley
- Fix postgres column constraint default syntax #4379 @pdebelak
- Allow function names to have a leading underscore #4377 @gavin-tsang
- TSQL: Merge Hints #4354 @AidanHarveyNelson
- TSQL: Temporal Table #4358 @AidanHarveyNelson
- TSQL: ALTER TABLE #4369 @AidanHarveyNelson
- Bugfix: Duckdb SELECT * #4365 @WittierDinosaur
- Postgres: TABLESAMPLE query #4357 @greg-finley
- reindent refactor #4338 @alanmcruickshank
- Snowflake: INSERT INTO #4363 @AidanHarveyNelson
- Docs: correct toml syntax of pyproject.toml file config example #4361 @imrehg
- Allowed Naked Identifiers #4359 @AidanHarveyNelson
- TSQL: TABLESAMPLE #4353 @AidanHarveyNelson
- Tsql: Function Parameters #4352 @AidanHarveyNelson
- Postgres: Storage parameters #4350 @AidanHarveyNelson
- TSQL: Bare Function Set #4351 @AidanHarveyNelson
- Postgres: View options #4340 @AidanHarveyNelson
- BigQuery: SELECT DISTINCT AS STRUCT #4341 @joar
- Snowflake: Fix Alter Warehouse #4344 @AidanHarveyNelson
- Parser: Optimise lookahead_match #4327 @WittierDinosaur
- Add support for dbt test macros #4319 @pdebelak
- Bracket complex expressions before applying :: operator in Rule L067 #4326 @pdebelak
New Contributors
- @AidanHarveyNelson made their first contribution in #4344
- @joar made their first contribution in #4341
- @jmpfar made their first contribution in #4356
- @jared-rimmer made their first contribution in #4403
- @vesatoivonen made their first contribution in #4335
- @briankravec made their first contribution in #4421
- @saintamh made their first contribution in #4417
[2.0.0a4] - 2023-01-26
Highlights
This is the fourth alpha release for 2.0.0. It contains a fix for the renamed dbt exceptions in dbt version 1.4.0, a fix for a major performance issue with the 2.0 dbt templater, and improvements to parse performance of large SQL files.
What’s Changed
- BigQuery: Alter table alter column #4316 @greg-finley
- Handle renamed dbt exceptions #4317 @greg-finley
- Parser: Fix early exit for simple matchers #4305 @WittierDinosaur
- MySQL: Add CREATE DATABASE and ALTER DATABASE #4307 @yoichi
- BigQuery: Add ALTER VIEW #4306 @yoichi
- toml: only install
tomldependency if < Python 3.11 (otherwise use builtintomllib) #4303 @kevinmarsh - Fix #4024 example plugin unit tests import #4302 @matthieucan
[2.0.0a3] - 2023-01-16
NOTE: This is an alpha release for testing purposes. There are several new features here, and breaking changes to configuration. We welcome testing feedback from the community, but know that this release may feel less polished than usual.
Highlights
This is the third alpha release for 2.0.0. It contains primarily bugfixes from 2.0.0a2 to allow continued testing. In particular, some of the recent 2.0.0-related changes to the dbt templater have been reverted, primarily due to performance and other issues. If those issues can be resolved, the changes will be re-introduced. The long-term goal of this work is to ease maintenance of the templater by separating dbt integration concerns from SQLFluff concerns.
There will likely be more changes to rule classification before a full release of 2.0.0, so anticipate that configuration files may change slightly again in future alpha releases.
What’s Changed
- Move ISSUE from Snowflake reserved keywords to unreserved ones #4279 @KaoutherElhamdi
- Due to performance and other issues, revert the osmosis implementation of the templater for now #4273 @barrywhart
- Simplify lexing #4289 @alanmcruickshank
- Fix #4255 (Fix exception on mixed indent description) #4288 @alanmcruickshank
- Fix #4253 (incorrect trigger of L006 around placeholders) #4287 @alanmcruickshank
- Fix #4249 (TSQL block comment indents) #4286 @alanmcruickshank
- Fix #4252 (Resolve multiple sensible indents) #4285 @alanmcruickshank
- Parser Performance: Cache segment string repr to reduce function calls #4278 @WittierDinosaur
- Snowflake: GRANT SUPPORT CASES #4283 @WittierDinosaur
- Dialect: duckdb #4284 @WittierDinosaur
- Snowflake: Add variable pattern to CopyIntoTable #4275 @WittierDinosaur
- Postgres: Non-reserved keyword bugfix #4277 @WittierDinosaur
- Hive: Add Table constraints DISABLE VALIDATE #4281 @WittierDinosaur
- Snowflake: Add Python and Java UDF support #4280 @WittierDinosaur
- SparkSQL: Support DIV binary operator #4282 @WittierDinosaur
- BigQuery: Add ALTER TABLE #4272 @yoichi
- Snowflake: Update bare functions #4276 @WittierDinosaur
- Improve Dockerfile to reduce image size #4262 @tdurieux
New Contributors
[2.0.0a2] - 2023-01-07
Highlights
This is the second alpha release for 2.0.0. It contains primarily bugfixes from 2.0.0a1 to allow continued testing along with dialect improvements for Snowflake, Postgres and DB2.
What’s Changed
- Push indents to after comments #4239 @alanmcruickshank
- Templated fix improvements and indentation #4245 @alanmcruickshank
- Fix block comment indent fixes #4224 #4240 @alanmcruickshank
- Fix for #4222 #4236 @alanmcruickshank
- Snowflake: Allow multiple unpivot #4242 @greg-finley
- postgres: add row-level locks to SELECT statements #4209 @Yiwen-Gao
- Add more parsing logic for db2 #4206 @NelsonTorres
- Include the filename in critical exceptions #4225 @alanmcruickshank
- Update Readme Badges #4219 @alanmcruickshank
- diff-quality: Handle the case where there are no files to check #4220 @barrywhart
[2.0.0a1] - 2022-12-28
Highlights
This is the first alpha version for 2.0.0. It brings all of the changes to whitespace handing, including a total rewrite of indentation and long line logic (L003 & L016). That brings several breaking changes to the configuration of layout, see the layout docs for more details and familiarise yourself with the new default configuration.
In addition, for the dbt templater, this introduces a large re-write of the codebase, dropping support for dbt versions before 1.0.0. This leverages functionality from dbt-osmosis to reduce the amount of functionality supported directly by SQLFluff, and performance during testing of the new version has been reported as significantly faster.
What’s Changed
- Fixed False Positive for L037 #4198 @WillAyd
- Indentation bug #4217 @alanmcruickshank
- Show fatal errors regardless #4214 @alanmcruickshank
- Don't consider templated whitespace #4213 @alanmcruickshank
- Don't pickle the templater #4208 @alanmcruickshank
- MySQL: Support column character set and collation #4204 @yoichi
- Fix some issues with Docker Compose environment #4201 @barrywhart
- Implicit Indents #4054 @alanmcruickshank
- Tweak Coveralls settings #4199 @barrywhart
- In addition to Codecov, also upload to Coveralls #4197 @barrywhart
- Fix: create table default cast returns unparsable section #4192 @NelsonTorres
- Fix JSON parsing issue with diff-quality plugin #4190 @barrywhart
- Codecov migration #4195 @alanmcruickshank
- Stop adding trailing os.sep if ignore file is on the root of the file… #4182 @baa-ableton
- Port dbt-osmosis templater changes to SQLFluff #3976 @barrywhart
- Reflow 4: Long Lines #4067 @alanmcruickshank
- Fix comment bug on reindent #4179 @alanmcruickshank
- Reflow 3: Reindent #3942 @alanmcruickshank
New Contributors
- @baa-ableton made their first contribution in #4182
- @WillAyd made their first contribution in #4198
[1.4.5] - 2022-12-18
Highlights
This is a bugfix release, primarily for diff-quality. In addition, a new rules for spacing around parenthesis is also included.
This is also the final 1.x.x release. Following releases will be a series of alpha releases for 2.x.x. If you affected by any outstanding bugs or regressions from this release, consider either rolling backward to a previous release without those issues, or failing forward to on an alpha release for 2.x.x (or a full release if that's out). Note that 2.x.x will bring a selection of breaking changes to config file structure, rule categorisation and dbt support.
What’s Changed
- Add rule for space around parenthesis #4131 @NelsonTorres
- diff-quality plugin: Print invalid JSON on parse failure #4176 @barrywhart
- Ensure diff-quality runs the correct SQLFluff #4175 @barrywhart
New Contributors
- @NelsonTorres made their first contribution in #4131
[1.4.4] - 2022-12-14
Highlights
Bug fix for 1.4.3 which was incorrectly flagging L006 for concat operators (||) and other two-symbol binary operators.
What’s Changed
- Recognise || as an operator to avoid rule L006 flagging it #4168 @tunetheweb
- 🐛 Check verbosity level of pytest run before running certain tests #4167 @pwildenhain
- [snowflake] Add support for snowflake select * exclude/replace syntax #4160 @moreaupascal56
[1.4.3] - 2022-12-13
Highlights
- Rewrote
diff-qualityplugin to run SQLFluff as a subprocess. More reliable, easier to switch betweendiff-qualityand runningsqlfluff lintdirectly. - New rule L067 enforces consistent syntax for type casts.
- New rule L068 enforces a consistent number of columns in set queries (e.g. UNION).
- Initial support for Materialize dialect.
What's Changed
- Add flyway variables support via placeholder templater #4026 @srjonemed
- Fix Spark comparison parsing #4066 @ms32035
- Add errors and fails to pytest summary #4076 @alanmcruickshank
- Storage reference segment #4057 @YilangHe
- New rule L069: Consistent syntax for sql type casting #3747 @bolajiwahab
- Postgres: Views and named notations #4073 @davetapley
- Switch reflow buffer from LintFix to LintResult #4083 @alanmcruickshank
- Support parallel linting when many individual files specified #4084 @barrywhart
- Rule: check number of columns in set operations match #4028 @erevear
- Fix syntax in indentation sample code docs #4087 @PBalsdon
- Remove "mystery" binary file added in PR #2923 #4088 @barrywhart
- Fix mypy issue with regex #4097 @barrywhart
- Enable variable reference names to have leading underscore for snowflake dialect #4098 @gavin-tsang
- Fix flake8 issue with segment_predicates.py #4101 @barrywhart
- Fix bug in example rule plugin #4103 @barrywhart
- Fix bug where L034 should ignore INSERT or "CREATE TABLE AS SELECT" with CTE #4108 @barrywhart
- Postgres: Alter type rename value #4100 @greg-finley
- Bug fix: dbt templater ignores .sqlfluff file encoding on Windows #4109 @barrywhart
- Add initial Materialize dialect #4112 @bobbyiliev
- L015: Handle COUNT(DISTINCT(col)) #4110 @barrywhart
- [Snowflake] format type options extensions for copy_into_location #4129 @YilangHe
- Fix tox arguments #4144 @greg-finley
- [DB2] Fix parsing of string identifiers #4134 @borchero
- BigQuery: Allow double quoted literal in export_option_list #4126 @yoichi
- Only upload 3 sets of test results to codecov (possible workaround for hanging builds) #4147 @barrywhart
- SparkSQL: ILIKE #4138 @greg-finley
- SparkSQL: Mark
ASas optional keyword for CTE & CTS #4127 @ulixius9 - Fix passenv to work with tox 4 #4154 @tunetheweb
- Allow deprecated --disable_progress_bar flag for fix command #4151 @pdebelak
- Implement diff_quality_plugin using command-line rather than Python #4148 @barrywhart
- L037: insert ASC just after column_reference #4149 @yoichi
New Contributors
- @srjonemed made their first contribution in #4026
- @ms32035 made their first contribution in #4066
- @davetapley made their first contribution in #4073
- @PBalsdon made their first contribution in #4087
- @gavin-tsang made their first contribution in #4098
- @bobbyiliev made their first contribution in #4112
- @ulixius9 made their first contribution in #4127
[1.4.2] - 2022-11-13
Highlights
This release is less about internals and much more about some quality of life improvements and dialect changes. The most notable are:
- The introduction of a
sqlfluff rendercommand to preview the results of templated sql. - Linting errors within templated loops should now only appear once in the linting output.
- Indentation around jinja
{% set %}statements should now be more consistent. - Linting errors around unparsable code are now more appropriately handled (with more to come soon on that front).
- Error messages when specified files aren't found are now more specific.
We've also got dialect improvements for Redshift, SOQL & SparkSQL.
What’s Changed
- Fix type error in
get_ruleshook of plugin example #4060 @Samyak2 - L003: Add missing "pragma: no cover" #4058 @barrywhart
- Fix bug in sparksql SELECT statement termination at UNION #4050 #4052 @anna-azizian
- Deduplicate violations in the source space #4041 @alanmcruickshank
- Use "docker compose", not "docker-compose" #4055 @barrywhart
- Allow warnings for specific rules #4053 @alanmcruickshank
- Better file not found error #1023 #4051 @alanmcruickshank
- Filter out issues in unparsable sections #4032 @alanmcruickshank
- Snowflake: ADD and DROP without COLUMN #4049 @greg-finley
- Make render command #4043 @alanmcruickshank
- Bump after_n_builds to 10 #4046 @greg-finley
- Redshift: allows for parenthesis around FROM content #3962 @adam-tokarski
- Update CI to use Python 3.11 #4038 @greg-finley
- Classify self contained set statements as templated #4034 @alanmcruickshank
- Date and Datetime literals in SOQL #4037 @alanmcruickshank
- mypy edits for 0.990 #4035 @alanmcruickshank
- sparksql: support for create/remove widget clause #4021 @Coola4kov
- Redshift CREATE EXTERNAL FUNCTION statement #4011 @rpr-ableton
- Update Redshift bare functions #4012 @rpr-ableton
New Contributors
- @Coola4kov made their first contribution in #4021
- @anna-azizian made their first contribution in #4052
[1.4.1] - 2022-10-31
Highlights
This is a fix to the configuration migration from 1.4.0. In that release, the configuration of leading/trailing operators would be migrated the wrong way around and precedence between new and old configuration values behaved unexpectedly.
What’s Changed
- Config precedence #4007 @alanmcruickshank
- Redshift CREATE/ATTACH/DETACH/DROP RLS POLICY statements #4004 @rpr-ableton
- Redshift: Add support for APPROXIMATE functions #3997 @rpr-ableton
- hotfix to config migration #4005 @alanmcruickshank
[1.4.0] - 2022-10-31
Highlights
This release brings several internal changes, and acts as a prelude to 2.0.0 which will be released fairly soon. In particular, the following config values have changed:
sqlfluff:rules:L007:operator_new_lineshas been changed tosqlfluff:layout:type:binary_operator:line_position.sqlfluff:rules:comma_styleandsqlfluff:rules:L019:comma_stylehave both been consolidated intosqlfluff:layout:type:comma:line_position.
If any of these values have been set in your config, they will be automatically translated to the new values at runtime, and a warning will be shown. To silence the warning, update your config file to the new values. For more details on configuring layout (including some changes yet to come in future versions) see the docs.
These changes are driven by underlying centralisation in the routines which control layout. While for this release, no breaking changes are expected - you may find slight differences in how SQLFluff handles edge cases. We believe in the majority of cases these are more consistent, but if you find any which are problematic then do post an issue on GitHub as usual.
Other highlights from this release:
- Better dbt supportfor graph nodes and avoiding dependency conflicts.
- Numerous dialect improvements to T-SQL, MySQL, SparkSQL, SQLite, Athena Snowflake, Hive, Postgres & Databricks.
There have also been first time contributions from 10 new contributors! 🎉🎉🎉
What’s Changed
- Snowflake partition nonreserved keyword #3972 @YilangHe
- Hive: Add support for EXCHANGE PARTITION in ALTER TABLE #3991 @nahuelverdugo
- Resolve parse error on multiple bracketed statements #3994 @yoichi
- Enable parsing of CLONE keyword in bigquery dialect #3984 @realLyans
- BigQuery: allow nesting of SetExpressionSegment #3990 @yoichi
- feat(clickhouse): Support non-standard CREATE TABLE statement #3986 @tomasfarias
- Fix Windows CI check #3992 @greg-finley
- Snowflake tag reference segment #3985 @WittierDinosaur
- Fix Jinja templater issue where undefined callable threw an exception #3982 @barrywhart
- Reflow Documentation V1 #3970 @alanmcruickshank
- Allow lambda argument columns to be unqualified #3971 @olagjo
- document inline configuration #3981 @alanmcruickshank
- [BUGFIX] Changing cwd temporarily on manifest load as dbt is not using project_dir to read/write target folder #3979 @barrywhart
- Fix type annotation of user_rules in
Linter#3977 @Samyak2 - Unpin
markupsafe#3967 @judahrand - Snowflake frame clause variables #3969 @WittierDinosaur
- SparkSQL: added support for : (colon sign) operator (Databricks SQL) #3956 @karabulute
- Athena: Add support for using underscore aliases #3965 @hectcastro
- Snowflake: ALTER TABLE constraint actions #3959 @erevear
- MySQL: Support REPLACE statement #3964 @yoichi
- TSQL: Add support for UPDATE STATISTICS option FULLSCAN #3950 @hectcastro
- ANSI: fixed typos in docstrings and comments #3953 @karabulute
- Postgres: ALTER PROCEDURE #3949 @krokofant
- T-SQL: Allow arbitrary expressions in PARTITION BY clause #3939 @borchero
- Enable dumping of performance information to csv. #3937 @alanmcruickshank
- Consolidate comma style configs #3945 @alanmcruickshank
- Adding missing KeywordSegments for different file types in Athena dialect #3898 @CommonCrisis
- Add templated block uuids #3936 @alanmcruickshank
- Load the full dbt manifest #3926 @davajm
- MySQL: Support optional "IF NOT EXISTS" with CREATE TRIGGER #3943 @yoichi
- T-SQL: Allow to parse SYNONYM statements #3941 @borchero
- Hive: Add support for LATERAL VIEW clause #3935 @hectcastro
- Fix crash in L042 on "UNION" or other "set" queries #3931 @barrywhart
- Refactor Lexer: Split apart elements_to_segments and refine placement of meta segments. #3925 @alanmcruickshank
- Add INSERT INTO <> DEFAULT VALUES to ANSI SQL and T-SQL #3934 @borchero
- Break apart reflow classes and extract methods #3919 @alanmcruickshank
- T-SQL: Fix indendentation of OUTER APPLY #3932 @borchero
- MySQL: Fix create trigger #3928 @adam-tokarski
- SparkSQL: Fixed bug with
QUALIFYusage withoutWHEREclause (applies also for Databricks dialect) #3930 @karabulute - T-SQL: Allow specifying join hints #3921 @borchero
- SQLite: Add support for table-level CHECK constraint #3923 @hectcastro
- sparksql: added * EXCEPT for SELECT clause #3922 @adam-tokarski
- Map old configs to new configs #3915 @alanmcruickshank
- [issue_3794] allow to use 'usage' as identifier for postgres #3914 @adam-tokarski
DATABRICKS: Add Support for Delta Live Tables (DLT) Syntax #3899 @R7L208- Postgres Revoke fix #3912 @greg-finley
- fix: Click output to stderr on errors #3902 @KingMichaelPark
- fix issue with empty enum for postgres #3910 @adam-tokarski
- feat: Optional numerics for postgres arrays #3903 @KingMichaelPark
- fix(test): Return ParseExample namedtuple in get_parse_fixtures #3911 @tomasfarias
- Fix typos #3901 @kianmeng
- provide custom DeprecatedOption #3904 @adam-tokarski
- fix(redshift): Allow keywords in qualified references #3905 @tomasfarias
- Reflow centralisation 2: Rebreak (operators & commas) #3847 @alanmcruickshank
- Bring L008 into reflow work #3908 @alanmcruickshank
- Snowflake: Create network policy ip lists #3888 @greg-finley
- MySQL: Implement (key_part, ...) in index definitions #3887 @yoichi
- Reflow centralisation 1: Scope + Respace #3824 @alanmcruickshank
- Update github badge and add docker badge #3884 @alanmcruickshank
New Contributors
- @kianmeng made their first contribution in #3901
- @KingMichaelPark made their first contribution in #3903
- @hectcastro made their first contribution in #3923
- @karabulute made their first contribution in #3930
- @davajm made their first contribution in #3926
- @CommonCrisis made their first contribution in #3898
- @krokofant made their first contribution in #3949
- @Samyak2 made their first contribution in #3977
- @realLyans made their first contribution in #3984
- @nahuelverdugo made their first contribution in #3991
- @YilangHe made their first contribution in #3972
[1.3.2] - 2022-09-27
Highlights
This is primarily a release for dialect fixes and improvements with additions and changes to TSQL, Snowflake, MySQL & Redshift. The other changes of note are:
- Support for warnings when users set old removed config values. This supports future change work by allowing a mechanism to warn if they are used.
- Improvements to the fix routines for L014 and L042 to handle some trickier cases.
What’s Changed
- Add CreateUserSegment for Snowflake dialect #3880 @Gal40n04ek
- raw_segments_with_ancestors #3878 @alanmcruickshank
- Adjust TSQL Operators #3877 @alanmcruickshank
- Refactor path_to #3875 @alanmcruickshank
- Support Removed warning on configs #3874 @alanmcruickshank
- MySQL: Support column-path operator for JSON type #3864 @yoichi
- T-SQL: ALTER FUNCTION/PROCEDURE/VIEW parsing #3867 @differgroup
- MySQL: Support hexadecimal literals and bit value literals #3869 @yoichi
- MySQL: Treat double quotes the same as single quotes #3871 @yoichi
- Snowflake: COMMIT WORK #3862 @rglbr
- Snowflake: AlterShareStatementSegment and CreateDatabaseFromShareStatementSegment #3858 @moreaupascal56
- MySQL: Add CREATE/ALTER VIEW #3859 @wfelipew
- Redshift: CREATE TABLE LIKE enhancements #3853 @greg-finley
- L014 leading underscore capitalization inference fix #3841 @j-svensmark
- MySQL: Add extended DROP TRIGGER functionality #3846 @yoichi
- Allow standalone aliases in L027 #3848 @olagjo
- L042: Enable autofix for some tricky cases #3700 @barrywhart
- Snowflake: CREATE FUNCTION IF NOT EXISTS #3845 @greg-finley
- ignore functions with more than one element ... #3792 @fmms
- MySQL: support remaining constraint parts of CREATE/ALTER TABLE #3827 @yoichi
New Contributors
- @olagjo made their first contribution in #3848
- @j-svensmark made their first contribution in #3841
- @wfelipew made their first contribution in #3859
- @moreaupascal56 made their first contribution in #3858
- @rglbr made their first contribution in #3862
- @differgroup made their first contribution in #3867
[1.3.1] - 2022-09-09
Highlights
- More refactoring of parse structures in preparation for upcoming refactor of formatting/whitespace rules.
- Fixes some bugs in L003 (indentation).
- New config flag
large_file_skip_byte_limitwhich applies prior to loading the file.
What’s Changed
- Snowflake: Fix syntax errors in tests #3834 @JamesRTaylor
- Add support for additional magic methods on DummyUndefined #3835 @barrywhart
- MySQL: support variable assignments by assignment operator := #3829 @yoichi
- MYSQL: improve lexing for single-quoted strings #3831 @mdahlman
- MySQL: More support for index definition in CREATE TABLE #3826 @yoichi
- Typed matching and ripping out the rest of .name #3819 @alanmcruickshank
- sparksql dialect to support lambda expressions (->) #3821 @juhoautio
- Fixed broken main branch #3825 @alanmcruickshank
- Enable file name logging for multi-files w/ --show-lint-violations flag #3788 @thechopkins
- Take database and schema out of Snowflake reserved keywords list #3818 @NiallRees
- Remove a chunk of name references #3814 @alanmcruickshank
- Fix typo in Snowflake dialect #3813 @Gal40n04ek
- Allow the use of libraries in macro definitions #3803 @bjgbeelen
- Indentation fixes and rule logging improvements #3808 @alanmcruickshank
- Fixes a recursion error in JinjaTemplater handling of undefined values #3809 @barrywhart
- Snowflake: extend
GRANTsyntax #3807 @Gal40n04ek - add warehouse_type in snowflake dialect #3805 @Gal40n04ek
- add Create Notification Integration syntax #3801 @Gal40n04ek
- T-SQL: fix parsing PARTITION BY NULL in window function #3790 @fmms
- SparkSQL: Update L014 rule to not flag Delta Change Data Feed Session & Table Property #3689 @R7L208
- Snowflake: OVER (ORDER BY) clause required for first_value (fixes #3797) #3798 @JamesRTaylor
- add Alter Pipe syntax for snowflake dialect #3796 @Gal40n04ek
- BigQuery: Parse WEEK() in date_part #3787 @yoichi
- Postgres: Support setting user properties using intrinsic ON & OFF values #3793 @chris-codaio
- extend SF dialect for File Format statements #3774 @Gal40n04ek
- Add QUALIFY to SparkSQL dialect #3778 @ThijsKoot
- fix regex for S3Path #3782 @Gal40n04ek
- Snowflake: add Optional parameter ERROR INTEGRATION for PIPE #3785 @Gal40n04ek
- Add a file size check in bytes #3770 @alanmcruickshank
- Require importlib_metadata >=1.0.0 #3769 @alanmcruickshank
New Contributors
- @Gal40n04ek made their first contribution in #3785
- @ThijsKoot made their first contribution in #3778
- @chris-codaio made their first contribution in #3793
- @JamesRTaylor made their first contribution in #3798
- @fmms made their first contribution in #3790
- @bjgbeelen made their first contribution in #3803
- @thechopkins made their first contribution in #3788
[1.3.0] - 2022-08-21
Highlights
This release brings several potentially breaking changes to the underlying parse tree. For users of the cli tool in a linting context you should notice no change. If however your application relies on the structure of the SQLFluff parse tree or the naming of certain elements within the yaml format, then this may not be a drop-in replacement. Specifically:
- The addition of a new
end_of_filemeta segment at the end of the parse structure. - The addition of a
template_loopmeta segment to signify a jump backward in the source file within a loop structure (e.g. a jinja for loop). - Much more specific types on some raw segments, in particular
identifierandliteraltype segments will now appear in the parse tree with their more specific type (which used to be calledname) e.g.naked_identifier,quoted_identifier,numeric_literaletc...
If using the python api, the parent type (such as identifier) will still register if
you call .is_type("identifier"), as this function checks all inherited types. However the
eventual type returned by .get_type() will now be (in most cases) what used to be accessible
at .name. The name attribute will be deprecated in a future release.
Other highlights:
- New command-line option
--show-lint-violationsto show details on unfixable errors when runningsqlfluff fix. - Improved consistency of process exit codes.
- Short CLI options for many common options.
- Jinja templater: When
--ignore=templatingis enabled, undefined Jinja variables now take on "reasonable" default values rather than blank string (""). This can streamline initial rollout of SQLFluff by reducing or eliminating the need to configure templater variables.
There are also a ton of other features and bug fixes in this release, including first-time contributions from 11 new contributors! 🎉
What’s Changed
- T-SQL: ALTER TABLE DROP COLUMN #3749 @greg-finley
- Add "# pragma: no cover" to work around sporadic, spurious coverage failure #3767 @barrywhart
- Add end_of_file and template_loop markers #3766 @alanmcruickshank
- Provide usage examples for new users #3765 @sirlark
- SQLite: deferrable in create table statement #3757 @RossOkuno
- When ignore=templating and fix_even_unparsable=True, provide defaults for missing vars #3753 @barrywhart
- BigQuery: Support Materialized Views #3759 @yoichi
- Enhance L062 to ignore blocked words in comments #3754 @tunetheweb
- Fix bug where undefined Jinja variable in macro file crashes linter #3751 @barrywhart
- Migrate analysis, functional and testing to utils #3743 @alanmcruickshank
- Build out rule crawling mechanisms #3717 @alanmcruickshank
- Add current_timestamp to Redshift as a bare function #3741 @RossOkuno
- BigQuery: Fix parsing parameterized data types #3735 @yoichi
- Change MySQL Create Statement Equals Segment to Optional #3730 @keyem4251
- SQLite: add parsing of INSERT statement #3734 @imrehg
- SPARKSQL: Support Delta Lake Drop Column Clause in
ALTER TABLE#3727 @R7L208 - Add short versions of several cli options #3732 @alanmcruickshank
- Build out type hints in Grammars #3718 @alanmcruickshank
- dbt 1.3.0 compatibility #3708 @edgarrmondragon
- Revise no cover direction and remove unused code. #3723 @alanmcruickshank
- Update broken flattr link #3720 @alanmcruickshank
- BigQuery: remove
keyfrom unreserved keywords list #3719 @sabrikaragonen - Bigquery reset primary and foreign keys #3714 @sabrikaragonen
- Name Deprecation (Part 1) #3701 @alanmcruickshank
- Teradata: Add two TdTableConstraints #3690 @greg-finley
- Redshift: support expressions in array accessors #3706 @chronitis
- Handle logging issues at teardown #3703 @alanmcruickshank
- L028, L032: Fix bug where fixes were copying templated table names #3699 @barrywhart
- L042: Autofix sometimes results in "fix looping", hitting the linter "loop limit" #3697 @barrywhart
- L042: Address corner cases where fix corrupts the SQL #3694 @barrywhart
- T-SQL: Properly parse collation names #3686 @borchero
- Allow escaping single quotes in single-quoted literal with '' #3682 @pdebelak
- T-SQL: Fix indentation after JOIN/APPLY clauses with no ON statement #3684 @borchero
- T-SQL: Parse
DATEPARTdate type as date type instead of column name #3681 @borchero - T-SQL: Allow
COLLATEclause inJOINconditions #3680 @borchero - T-SQL: Fix parsing of CREATE VIEW statements with column name syntax #3669 @borchero
- Fix typo in github issue template #3674 @alanmcruickshank
- Add Athena issue label #3676 @greg-finley
- Set issue dialect labels via Github Actions #3666 @greg-finley
- Allow configuration of processes from config #3662 @alanmcruickshank
- Reposition before recursion in fixes to avoid internal error #3658 @alanmcruickshank
- Use UUIDs for matching #3661 @alanmcruickshank
- Postgres: Add dialect-specific bare functions #3660 @WittierDinosaur
- Postgres: Add
CALLSupport #3659 @WittierDinosaur - ANSI - Add support for
INTERSECT ALLandEXCEPT ALL#3657 @WittierDinosaur - Option to show errors on fix #3610 @chaimt
- L042: Fix internal error "Attempted to make a parent marker from multiple files" #3655 @barrywhart
- L026: Add support for
merge_statement#3654 @barrywhart - Add handling for Redshift
CONVERTfunction data type argument #3653 @pdebelak - Deduplicate files before and during templating #3629 @alanmcruickshank
- Rationalise Rule Imports #3631 @alanmcruickshank
- Handle Jinja
{% call ... %}blocks #3648 @barrywhart - SPARKSQL: Add Delta Lake Constraints syntax to
ALTER TABLE#3643 @R7L208 - Redshift: syntax for array unnesting with index #3646 @chronitis
- Snowflake -
ALTER TABLE IF EXISTSandWHEN SYSTEM$STREAM_HAS_DATA()#3641 @chrisalexeev - L057: In BigQuery, allow hyphens by default #3645 @barrywhart
- Better messages for partial indentation in L003 #3634 @pdebelak
- Add
INTEGERtoPrimitiveTypeSegmentfor Sparksql #3624 @ciwassano - Bump version in gettingstarted.rst via the release script #3642 @greg-finley
- Improve handling of BigQuery hyphenated table names #3638 @barrywhart
- update sqlfluff version in gettingstareted.rst #3639 @keyem4251
- L016: Ignore jinja comments if
ignore_comment_clauses=True#3637 @barrywhart - Add errors for redundant definitions. #3626 @alanmcruickshank
- Object Literals #3620 @alanmcruickshank
- Dialect Crumbs #3625 @alanmcruickshank
- Consistent return codes #3608 @alanmcruickshank
New Contributors
- @keyem4251 made their first contribution in #3639
- @ciwassano made their first contribution in #3624
- @chronitis made their first contribution in #3646
- @chaimt made their first contribution in #3610
- @borchero made their first contribution in #3669
- @sabrikaragonen made their first contribution in #3714
- @edgarrmondragon made their first contribution in #3708
- @imrehg made their first contribution in #3734
- @yoichi made their first contribution in #3735
- @RossOkuno made their first contribution in #3741
- @sirlark made their first contribution in #3765
[1.2.1] - 2022-07-15
Highlights
This is primarily a bugfix release to resolve an issue with the 1.2.0 release
where the new version of sqlfluff-templater-dbt relied on functionality
from the new version of sqlfluff but the package configuration had not
been updated. Versions of the two packages are now pinned together.
What’s Changed
- Pin sqlfluff-templater-dbt via release script #3613 @greg-finley
- Specifying comma delimited is unnecessary #3616 @alanmcruickshank
- Handle redshift temporary tables with # at the beginning of name #3615 @pdebelak
[1.2.0] - 2022-07-13
Highlights
Major changes include:
- Adding AWS Athena as a dialect.
- A fix routine for L046 (whitespace in jinja tags), and the mechanisms for more source-only fixes in future.
- By default, large files (over 20k characters) are now skipped by sqlfluff. This limit is configurable and disable-able but exists as a sensible default to avoid the performance overhead of linting very large files.
- For the dbt templater, fatal compilation errors now no longer stop linting, and these files are now skipped instead. This enables projects to continue linting beyond the offending file and much better logging information to enable better debugging.
What’s Changed
- Improve documentation for custom implemented rules #3604 @Aditya-Tripuraneni
- Add a skip and better logging for fatal dbt issues #3603 @alanmcruickshank
- Add large file check #3600 @alanmcruickshank
- Oracle: extend support for
ALTER TABLE#3596 @davidfuhr - Immutability fixes #3428 @alanmcruickshank
- Struct type should be a segment #3591 @alanmcruickshank
- Fix Bracketed Struct issue #3590 @alanmcruickshank
- Allow spaces and multiple signs for numeric literals #3581 @tunetheweb
- Add source fixing capability and fix routines for L046 #3578 @alanmcruickshank
- Small grammar cleanup in team rollout docs #3584 @theianrobertson
- Postgres:
CREATE COLLATIONsupport #3571 @greg-finley - Redshift: Add
TOP Xto select clause modifiers #3582 @pdebelak - Postgres: Small fixes to
COMMENT ON#3566 @greg-finley - Support MySQL system variables #3576 @qgallet
- Allow no alias for selects in CTEs with a column list #3580 @pdebelak
- New dialect AWS Athena #3551 @cmotta
- Split apart
fix_string(). #3568 @alanmcruickshank - Fix incorrect L022 with postgres dialect with CTE argument list #3570 @pdebelak
- Simplify lint fixing (prep for source fixes) #3567 @alanmcruickshank
- Exclude .coverage.py from linting #3564 @zidder
- L016:
ignore_comment_clausesnot working for postgres dialect #3549 @barrywhart - Groundwork for a fix routine for L046 #3552 @alanmcruickshank
- Add better handling for SQLFluffUserError when running core cli commands #3431 @alanmcruickshank
New Contributors
- @pdebelak made their first contribution in #3570
- @cmotta made their first contribution in #3551
- @qgallet made their first contribution in #3576
- @theianrobertson made their first contribution in #3584
- @davidfuhr made their first contribution in #3596
- @Aditya-Tripuraneni made their first contribution in #3604
[1.1.0] - 2022-07-03
Highlights
Major changes include:
- L066 - New rule to allow you to set min/max length requirements for aliases to ensure they are meaningful
- L062 - addition of
blocked_regexas well asblocked_words - L025 - fix several corner cases where aliases were removed inappropriately
- L059 is now disabled by default for Postgres
- Many more dialect improvements and bug fixes.
Highlights
What’s Changed
- L025: Derived query requires alias -- also handle UNION, etc. #3548 @barrywhart
- L025 should not remove aliases from derived queries #3546 @barrywhart
- T-SQL keyword functions should be treated as keywords #3540 @tunetheweb
- Fix issue where "--nocolor" is ignored [#3536)(https://github.com/sqlfluff/sqlfluff/pull/3536) @barrywhart
- Clickhouse: allow
FINALmodifier #3534 @ThomAub - L018 change to just check for newlines rather than alignment #3499 @zidder
- SparkSQL: Update terminator grammar for
HAVING,WHERE,GROUP BY#3526 @R7L208 - Fix L025 false positive for T-SQL
VALUESclause #3533 @barrywhart - New rule L066 for enforcing table alias lengths #3384 @f0rk
- Redshift:
CALLstatement #3529 @greg-finley - Core: Compile regexes at init time to avoid overhead #3511 @judahrand
- Disable L059 by default for Postgres #3528 @tunetheweb
- Core: Add
MultiStringParserto match a collection of strings #3510 @judahrand - SQLite:
PRIMARY KEY AUTOINCREMENT#3527 @greg-finley - MySQL: Support
LOAD DATA#3518 @greg-finley - Redshift:
GRANT EXECUTE ON PROCEDURES#3516 @greg-finley - Allow
DEFAULTexpression in RedshiftALTER TABLE ADD COLUMNstatements #3513 @menzenski - BigQuery: Fix parsing of Array creation from full subquery #3502 @judahrand
- SparkSQL: Allow dateparts as table aliases #3500 @R7L208
- Fix
load_macros_from_pathto actually support multiple paths #3488 @emancu - Allow linter to apply fixes spanning more than 2 slices #3492 @barrywhart
- Fix L022 false positive when the CTE definition has a column list #3490 @barrywhart
- SparkSQL: Support for Delta
RESTOREstatement #3486 @R7L208 - Add values function to
SETclause #3483 @hgranthorner - SparkSQL: Support for
CONVERT TO DELTAcommand #3482 @R7L208 - BigQuery: Remaining procedural statements #3473 @tunetheweb
- Postgres: support grouping sets #3477 @tunetheweb
- SparkSQL: Support for Delta syntax to create manifest files through the
GENERATEcommand #3478 @R7L208 - Add config for optionally indenting contents of
ONblocks #3471 @PeterBalsdon - L026: check standalone aliases as well as table aliases #3470 @tunetheweb
- L045: Add handling for nested queries and CTEs #3468 @barrywhart
- L062: add
blocked_regexsupport #3467 @tunetheweb - SparkSQL: Support for the Delta
DESCRIBE DETAILcommand #3465 @R7L208
New Contributors
- @PeterBalsdon made their first contribution in #3471
- @hgranthorner made their first contribution in #3483
- @emancu made their first contribution in #3488
- @judahrand made their first contribution in #3502
- @f0rk made their first contribution in #3384
- @zidder made their first contribution in #3499
- @ThomAub made their first contribution in #3534
[1.0.0] - 2022-06-17
Highlights
This is the first stable release of SQLFluff 🎉🎉🎉.
- Does this mean there are no more bugs? No.
- Does this mean we're going to stop developing new features? No.
- Does this mean that this is a tool that is now broadly usable for many teams? Yes.
We've intentionally chosen to release 1.0.0 at a time of relative stability within SQLFluff and not at a time when new big structural changes are being made. This means that there's a good chance that this release is broadly usable. This also recognises that through the hard work of a huge number of contributors that we've built out this from a fringe tool, to something which gets over 500k downloads a month and over 4k stars on Github.
There's still a lot to do, and some more exciting things on the horizon. If you want to be part of this and join the team of contributors, come and hang out in our slack community or on our twitter account where people can help you get started. If you're a long time user, keep submitting bug reports and inputting on issues on Github.
If you've never used SQLFluff before, or are hesitant about starting to use it in your day to day work, now might be a good time to try it. We have guides on how to get started with the tool, and how to get started with rolling out to a team in our docs.
What’s Changed
- Swap to skip file if not found #3464 @alanmcruickshank
- Postgres: treat
GENERATE_SERIESas a value table function #3463 @tunetheweb - Postgres: Support multiple
CONSTRAINTSinCREATE DOMAIN#3460 @tunetheweb - Redshift: Add
ANYELEMENTsupport #3458 @tunetheweb - Postgres: Optional select clause elements and better
ON CONFLICTsupport #3452 @tunetheweb - Add ClickHouse as a dialect #3448 @tunetheweb
- Postgres: allow keywords in qualified column references #3450 @tunetheweb
- Remove Baron Schwatz Dead Link #3453 @tunetheweb
- Postgres: Finish
ALTER TYPE#3451 @greg-finley - SparkSQL: Add Delta Syntax for
DESCRIBE HISTORYstatement #3447 @R7L208 - Snowflake: Support Stage data file parameters in
FROMclauses #3446 @tunetheweb - Redshift: Support Object unpivoting #3441 @tunetheweb
- Python script to automate release #3403 @greg-finley
- Remove Delta Lake Reference in README.md #3444 @R7L208
- Add
databricksdialect as an alias forsparksqldialect #3440 @R7L208 - Make all Postgres identifiers quotable #3442 @tunetheweb
- Update JinjaAnalyzer and JinjaTracer to handle
{% block %}#3436 @barrywhart - SparkSQL: Add support for Delta
VACUUMstatement #3439 @R7L208 - Warning for parsing errors extended to all dialects #3411 @mdahlman
- Handle templater validation errors more gracefully #3433 @alanmcruickshank
- MYSQL: allow for escaped single quotes #3424 @mdahlman
- L027: Fix false positives by reverting the PR for issue #2992: Check table aliases exist #3435 @barrywhart
- Allow
numeric_dollartemplater to have curly braces, updatedollar+numeric_dollartemplater examples in docs #3432 @menzenski - Allow Redshift
IDENTITYcolumn(seed, step)to be optional #3430 @menzenski - L036: Make wildcard behavior configurable #3426 @barrywhart
- L034: Don't autofix if numeric column references #3423 @barrywhart
- L036: Treat wildcard as multiple select targets (i.e. separate line) #3422 @barrywhart
- Snowflake: IDENTIFIER pseudo-function #3409 @mdahlman
- SNOWFLAKE: Fully referenced object names in clone statements #3414 @mdahlman
- Unpin coverage now issue with 6.3 has been resolved #3393 @tunetheweb
- L045: handle
UPDATEstatements with CTEs #3397 @tunetheweb - L027: Add support for
ignore_words#3398 @dmohns - Postgres: Allow
CREATE FUNCTIONto use Expressions in default values #3408 @tunetheweb - Fix bug in
apply_fixes()with leading/trailing whitespace #3407 @barrywhart - Redshift: Correct
ALTER TABLEsyntax #3395 @tunetheweb - Postgres: Parse index with column sort #3405 @greg-finley
- MySQL: Improve SET Syntax for Variable Assignment #3394 @mdahlman
- Handle Postgres-style type casts when using the
colon_nospacestemplating style #3383 @benji-york - Capitalization in help message #3385 @mdahlman
- MySQL: Update keywords #3381 @mdahlman
- Teradata: Database statement and Set Session Database #3382 @mdahlman
New Contributors
- @benji-york made their first contribution in #3383
- @menzenski made their first contribution in #3430
[0.13.2] - 2022-05-20
Highlights
Major changes include:
- Fix bug causing L003 to report indentation errors for templated code - sorry we know that one's caused many of you some grief :-(
- Initial support of SOQL (Salesforce Object Query Language).
- Additional Placeholder templating options.
- Start of BigQuery procedural language support (starting simple
FORstatements andCREATE PROCEDUREstatements). - New rule L065 to put set operators onto new lines.
- Many more dialect improvements and bug fixes.
What’s Changed
- All dialects: Allow
RESPECT NULLS/IGNORE NULLSin window functions #3376 @tunetheweb - Postgres: correct
RETURNS TABLEcolumn type #3379 @tunetheweb - L065: Add rule for set operators surrounded by newlines #3330 @dmohns
- L064: Apply preferred quote-style for partially templated quoted literals #3300 @dmohns
- BigQuery: Support Stored Procedures #3369 @tunetheweb
- MySQL extra Boolean operators (
&&,||,!) #3359 @mdahlman - Postgres and Redshift: Support
LOCK [TABLE]#3350 @tunetheweb - Placeholder updates: Allow optional braces in dollar placeholders, add
colon_nospaces, and cast to string #3354 @tunetheweb - BigQuery: Basic
FOR..IN..DO...END FORsupport #3340 @tunetheweb - L025: exclude
VALUESclauses #3358 @tunetheweb - GitHub Actions: Update existing PR on new runs #3367 @greg-finley
- GitHub Actions: Copy draft release notes to CHANGELOG #3360 @greg-finley
- GitHub Action to set version number #3347 @greg-finley
- Postgres and Redshift: support
ALTER SCHEMA#3346 @mdahlman - MySQL: better
SELECT..INTOsupport #3351 @tunetheweb - Postgres: support better function calls in
CREATE TRIGGER#3349 @tunetheweb - Misc rule doc updates #3352 @tunetheweb
- Snowflake: Move
CASEkeyword to Unreserved list #3353 @tunetheweb - MySQL: Added support for multiple variables in
SETstatement. #3328 @cgkoutzigiannis - SOQL: Support
date_n_literal#3344 @greg-finley - Update Docs: Getting Started and Index #3339 @mdahlman
- SOQL: Disable L026 rule #3338 @greg-finley
- Fix critical parse error logged after L003 fix #3337 @barrywhart
- SOQL: Disallow non-
SELECTstatements #3329 @greg-finley - ci: bump github actions #3336 @Fdawgs
- Start SOQL dialect #3312 @greg-finley
- Hive: support
CLUSTER,DISTRIBUTE,SORT BY#3304 @barunpuri - Fix typo in Configuration documentation #3319 @mdahlman
- L011: Support
MERGEstatements #3292 @tunetheweb - BigQuery: Add workaround to fix false-positves of L063 #3306 @dmohns
- Snowflake:
REMOVEstatement rework #3308 @jmc-bbk - Snowflake:
PUTstatement #3307 @jmc-bbk - Snowflake:
GETstatement #3305 @jmc-bbk - Snowflake: Support
ALTER EXTERNAL TABLE#3302 @jmc-bbk - T-SQL: Fix
PIVOTplacement #3298 @jpers36 - Cleanup role references #3287 @tunetheweb
- Adding Typeform and videoask into inthewild.rst #3296 @omonereo-tf
- Snowflake:
LISTstatement enhancement #3295 @jmc-bbk - MySQL: Support
CREATE USER#3289 @greg-finley - Snowflake: CREATE STAGE grammar enhancement for file formats #3293 @jmc-bbk
- T-SQL: Complete support for
DELETEstatement #3285 @pguyot - MySQL: Support account names #3286 @greg-finley
- L028: In T-SQL dialect, table variables cannot be used to qualify references #3283 @barrywhart
- L007: An operator on a line by itself is okay #3281 @barrywhart
- L046 (spaces around Jinja tags) should check all slices in a segment #3279 @barrywhart
- L003 bug fix: Not ignoring templated newline #3278 @barrywhart
New Contributors
- @omonereo-tf made their first contribution in #3296
- @mdahlman made their first contribution in #3319
- @cgkoutzigiannis made their first contribution in #3328
[0.13.1] - 2022-05-06
Highlights
Major changes include:
- Addition of "rule groups" (currently
coreandall) to allow ease of turning on and off groups of rules. - Addition of
db2dialect - PRS errors are now highlighted in red.
- Many bugs fixes and dialect improvements
What’s Changed
- Allow optional
ASinMERGEstatements usingSELECT#3276 @tunetheweb - Add groups each rule is in to Rules documentation #3272 @tunetheweb
- BigQuery: Enhanced
EXPORT DATAstatement #3267 @tunetheweb - BigQuery:
CREATE TABLEsupport forCOPYandLIKE#3266 @tunetheweb - Improve error on missing keywords #3268 @greg-finley
- MySQL: Add
FLUSHsupport #3269 @greg-finley - Postgres: Add
ALTER TYPEsupport #3265 @greg-finley - Bug fix: L036 handle single-column
SELECTwith comment on same line asSELECTkeyword #3259 @barrywhart - Put working example in the README #3261 @greg-finley
- Snowflake: Add
CREATE FILE FORMATSupport #3104 @jmc-bbk - Bug fix: Disable L059 in snowflake dialect #3260 @barrywhart
- Remove redundant
Anything()frommatch_grammars#3258 @tunetheweb - Postgres: Add
DOMAINsupport #3257 @tunetheweb - T-SQL: Allow optional brackets with
EXECUTE#3255 @pguyot - Add rule groups and a core rules group #3142 @pwildenhain
- MySQL: Better
UNSIGNEDsupport #3250 @tunetheweb - MySQL (and others): Support
DROP TEMPORARY TABLE#3251 @tunetheweb - Add Db2 dialect #3231 @ddresslerlegalplans
- BigQuery: Add
CREATE EXTERNAL TABLEstatement #3241 @dmohns - SQLite: Add support for expressions in
CREATE INDEXcolumns #3240 @tunetheweb - Fix exception in
check_still_completeand matching inStartsWith#3236 @tunetheweb - Snowflake: Add Support for
DROPStatements #3238 @chrisalexeev - Allow YAML generation script to accept arguments when run through
tox#3233 @tunetheweb - Bug fix: Cleanly catch and report errors during
load_macros_from_path#3239 @barrywhart - Indent procedure parameters #3234 @fdw
- Enhance
apply_fixes()to automatically fix violations ofcan_start_end_non_code#3232 @barrywhart - T-SQL: Fix
for xml pathidentifier #3230 @fdw - SparkSQL: Additional Delta Merge Test Cases #3228 @R7L208
- Fix bug where L018 warns inappropriately if CTE definition includes a column list #3227 @barrywhart
- BigQuery: Better
STRUCTsupport #3217 @tunetheweb - Fix bug where L003 and L036 fixes caused a parse error #3221 @barrywhart
- Make
IF EXISTSwork withUNIONselects #3218 @fdw - Fix bug where the
fix_even_unparsablesetting was not being respected in.sqlfluff#3220 @barrywhart - BigQuery: Better
DELETEtable support #3224 @tunetheweb - Snowflake:
ALTER MATERIALIZED VIEWstatement #3215 @jmc-bbk - BigQuery: recognise
DATE,DATETIMEandTIMEas a date parts forEXTRACT#3209 @tunetheweb - Postgres: enhanced
UPDATEstatement support #3203 @tunetheweb - Prevent Date Constructors from being changed to double quotes by L064 #3212 @tunetheweb
- Postgres: Fix
DROP EXTENSIONsyntax #3213 @tunetheweb - Snowflake: Handle
FLATTEN()table function aliases correctly in L025, L027, L028 #3194 @barrywhart - Snowflake: Function
LANGUAGE SQL#3202 @WittierDinosaur - Postgres: Enhanced
CREATE MATERIALIZED VIEW#3204 @tunetheweb - T-SQL: Support basic
FOR XMLstatements #3193 @fdw - T-SQL: Fix cursor syntax #3192 @fdw
- Snowflake:
REMOVEstatement enhancement #3191 @jmc-bbk - Snowflake: Moved
VIEWto unreserved keywords #3190 @WittierDinosaur - BigQuery: Support
EXPORT DATA#3177 @tunetheweb - T-SQL: Fix exception when using variable names in
FROMclause #3175 @tunetheweb - Fix bug where
encodingsetting in .sqlfluff file was not being respected #3170 @barrywhart - Highlight
PRSerrors in red #3168 @OTooleMichael - Remove unnecessary
StartsWithand maketerminatormandatory when using it #3165 @tunetheweb - Postgres: Support Composite Types #3167 @tunetheweb
- T-SQL: Support opening, closing, deallocating and fetching cursors #3166 @fdw
- T-SQL: Add declaration of cursors #3164 @fdw
- Missed #3151 from CHANGELOG #3163 @tunetheweb
- Bug fix: L028 sometimes makes incorrect fix when there are subqueries #3156 @barrywhart
- T-SQL: Support
OUTPUT INTO#3162 @fdw - T-SQL: Add
CREATE TYPEstatement #3154 @fdw - Hive: Support
TABLESAMPLE#3159 @barunpuri - Hive: Support back quoted identifier and literal #3158 @barunpuri
- T-SQL: Add table hints to
INSERTandDELETE#3155 @fdw
New Contributors
- @ddresslerlegalplans made their first contribution in #3231
- @greg-finley made their first contribution in #3261
[0.13.0] - 2022-04-22
Highlights
Major changes include:
- New Rule (L064) for preferred quotes for quoted literals
- Rule speed improvements and fixing performance regression from 0.12.0
- Add configuration option to disallow hanging indents in L003
- Add
ignore_words_regexconfiguration option for rules - New GitHub Annotations option
- Many bug fixes and dialect improvements
What’s Changed
- Redshift: Fix CREATE TABLE column constraints and COPY #3151 @tunetheweb
- New Rule L064: Consistent usage of preferred quotes for quoted literals #3118 @dmohns
- L025 bug fix: stop incorrectly flagging on nested inner joins #3145 @tunetheweb
- T-SQL: Add labels, as well as
GRANT/DENY/REVOKE#3149 @tunetheweb - Snowflake: allow bracketless
VALUESinFROMclauses #3141 @tunetheweb - T-SQL: Support
TRY_CONVERT#3143 @fdw - T-SQL: Support
NVARCHAR(MAX)#3130 @fdw - Allow column-less
INSERT INTOwith bracketedSELECTin ANSI and BigQuery #3139 @tunetheweb - Hive: Support dynamic partition insert #3126 @barunpuri
- T-SQL -
ALTER TABLE- add support forWITH CHECK ADD CONSTRAINTandCHECK CONSTRAINT#3132 @nevado - TSQL: Support names for transactions #3129 @fdw
- Snowflake:
StartsWith()inFromExpressionElementSegmentcaused performance issues for large queries #3128 @WittierDinosaur - Fix parsing of Compound Statements #3121 @jonyscathe
- SparkSQL: Update to support all valid Literal Types #3102 @R7L208
- TSQL: Exclude non-function-name keywords from function names #3112 @jpers36
- ANSI
AT TIME ZONEparsing improvements #3115 @tunetheweb - When fixing a file, preserve the input file's permissions #3114 @barrywhart
- Bug: L058 (flatten nested
CASE) triggers incorrectly (theELSEcontains additional code) #3113 @barrywhart - Bug fix: Handle "lint" human-format file output correctly #3109 @barrywhart
- L003: Add configuration option to disallow hanging indents #3063 @dmohns
- Add native Github-actions output #3107 @dmohns
- Improved signed literal parsing #3108 @tunetheweb
- Don't allow fixes to span template blocks #3105 @barrywhart
- Add
ignore_words_regexconfiguration option #3098 @dmohns - Redshift: Better
AT TIME ZONEsupport #3087 @tunetheweb - Fix In The Wild typo #3100 @sivaraam
- Snowflake: Add Create Storage Integration grammar. #3075 @jmc-bbk
- ANSI: Allow
indented_using_oninMERGEstatementsON#3096 @dmohns - Postgres: Support
COLLATEin more clauses #3095 @tunetheweb - BigQuery: Support
NORMALIZEfunction #3086 @tunetheweb - ANSI (and other dialects): Add
DROP FUNCTIONsupport #3082 @tunetheweb - Postgres: Support
DROP EXTENSION#3083 @tunetheweb - Snowflake: Fix bug in Describe Statement #3076 @jmc-bbk
- Update individual rules to take advantage of core rule processing changes #3041 @barrywhart
- L003 forgives non misbalanced Jinja tags #3065 @OTooleMichael
- Fix tsql dialect
EXEC = @Variable StoredProcFailed Parsing Bug (#3070) #3077 @MartynJones87 - Snowflake Dialect: Add External Function DDL #3071 @chrisalexeev
- SparkSQL: Support for Delta
UPDATEstatement syntax #3073 @R7L208 - SparkSQL: Test cases for Delta
DELETE FROMsyntax #3072 @R7L208 - Postgres: Support quoted
LANGUAGEparams #3068 @tunetheweb - Fix bug handling Jinja set with multiple vars, e.g.:
{% set a, b = 1, 2 %}#3066 @barrywhart - L007 should ignore templated newlines #3067 @barrywhart
- Allow aliases to pass L028 #3062 @tunetheweb
- Refactor core rule processing for flexibility and speed #3061 @barrywhart
- Add editorconfig and precommit for SQL and YML files #3058 @tunetheweb
- Rule L003 performance: Cache the line number and last newline position #3060 @barrywhart
- Fixed documentation for
sql_file_extsexample #3059 @KulykDmytro - BigQuery: Support
SAFEfunctions #3048 @tunetheweb - Postgres: Fix
UNNESTfor L025 #3054 @tunetheweb - Exasol:
CREATE/DROP/ALTER USER/ROLEclean up for consistency #3045 @tunetheweb - Postgres add
ALTER ROLE/ALTER USERsupport #3043 @mrf - Add CarePay to SQLFluff in the wild #3038 @pvonglehn
- Postgres: Add
ON CONFLICTGrammar #3027 @jmc-bbk - Add dialect to Docker test #3033 @tunetheweb
New Contributors
- @chrisalexeev made their first contribution in #3071
- @MartynJones87 made their first contribution in #3077
- @sivaraam made their first contribution in #3100
- @jonyscathe made their first contribution in #3121
- @barunpuri made their first contribution in #3126
[0.12.0] - 2022-04-07
Highlights
Major changes include:
- Dialect is now mandatory, either in command line, or in config BREAKING CHANGE
- Rename
spark3dialect tosparksqlBREAKING CHANGE - L027 now checks tables references exist BREAKING CHANGE
- New rule L063 to allow Datatypes to have a different capitalisation policy from L010. BREAKING CHANGE
- Refactor and performance improvements of Delimited and L003
- Many dialect improvements and fixes
What’s Changed
- MySQL: Allow
JOINs inUPDATEexpressions #3031 @zapion - Fix bug in patch generation for segments made of templated + literal fixes #3030 @barrywhart
- Formatters code cleanup #3029 @barrywhart
- Postgres better
CREATE USER/CREATE ROLEsupport #3016 @mrf - SparkSQL: Add
MERGEsyntax #3025 @PhilippLange - Remove Delimited workarounds #3024 @tunetheweb
- Add
excludeoption forRefgrammar #3028 @tunetheweb - SparkSQL: Adding support for Delta Lake table schema updates #3013 @R7L208
- L027: Check table aliases exists #2998 @dmohns
- Snowflake: Added support for
REMOVEstatements #3026 @WittierDinosaur - BigQuery: Support
WEEKfunction with days of weeks #3021 @tunetheweb - Sparksql quoted identifier in
STRUCT#3023 @PhilippLange - Force user to specify a dialect #2995 @barrywhart
- BigQuery: Parse
CREATE TABLEwith trailing comma #3018 @dmohns - Snowflake: Add
IS (NOT) DISTINCT FROMtest cases #3014 @kd2718 - BigQuery: Add support for column
OPTIONSinSTRUCTdefinitions #3017 @dmohns - PostgreSQL: added support for
CREATE ROLEandDROP ROLEstatements #3010 @dnim - Separate slow CI job to it's own workflow #3012 @tunetheweb
- SparkSQL: Test cases for Delta Variation of Writing a table #3009 @R7L208
- Snowflake: Added support for
CLUSTER BYand otherCREATE TABLEimprovements #3008 @WittierDinosaur - Support
TRIMfunction parameters #3007 @tunetheweb - BigQuery: Support
AT TIME ZONEinEXTRACT#3004 @tunetheweb - BigQuery: Move some keywords to unreserved #3002 @tunetheweb
- BigQuery: Allow quoted variable names in
DECLARE#3006 @dmohns - T-SQL: allow optional
ASkeyword in parameters def #3001 @pguyot - T-SQL: add support for
RETURNS @var TABLEsyntax #3000 @pguyot - T-SQL: add support for parenthesized nested joins #2993 @pguyot
- dbt: Read builtins from code #2988 @dmohns
- T-SQL: fix table type in
DECLAREstatements #2999 @pguyot - T-SQL: allow leading
GO#2997 @pguyot - T-SQL: add support for assignment operators #2996 @pguyot
- BigQuery: Add more
MERGEstatement variants #2989 @dmohns - L041: Fix bug when there is a newline after the select clause modifier #2981 @jmc-bbk
- Rule L045 doesn't recognise CTE usage in a subquery when rule L042 is enabled #2980 @barrywhart
- dbt: Make
is_incremental()defaults consistent #2985 @dmohns - Rename Grammars for consistency #2986 @tunetheweb
- Added support for MySQL
UPDATEStatements #2982 @WittierDinosaur - Redshift: Added
CREATE EXTERNAL SCHEMA, bugfix inPARTITION BY#2983 @WittierDinosaur - Added
ALTER INDEXandREINDEXto Postgres, Some Grammar Cleaning #2979 @WittierDinosaur - T-SQL grammar deduplication #2967 @tunetheweb
- L003 Refactor #2884 @OTooleMichael
- Delimited Refactor #2831 @WittierDinosaur
- SparkSQL: Support for querying snapshots when reading data with Delta Lake #2972 @R7L208
- Fix bug in L063 for BigQuery
STRUCTparams #2975 @tunetheweb - Fix assertion error in dbt templater when file ends with whitespace strip (
-%}) #2976 @barrywhart - Pass dbt vars to dbt #2923 @tcholewik
- BigQuery: Add support for column
OPTIONS#2973 @dmohns - BigQuery: Allow expressions in
OPTIONSclauses #2971 @dmohns - Bump black to 22.3.0 on pre-commit #2969 @pguyot
- T-SQL: Redefine
DatatypeIdentifierSegment#2959 @alanmcruickshank - T-SQL: Add support for
WAITFORstatement #2968 @pguyot - T-SQL: Add
WHILEstatement support #2966 @pguyot - T-SQL:
INTOis optional withinINSERTstatement #2963 @pguyot - Add basic
IS (NOT) DISTINCT FROMsupport in most dialects #2962 @tunetheweb - SparkSQL: Create Table Delta Lake Variant #2954 @R7L208
- T-SQL: Add support for
CREATE/DROP/DISABLETRIGGER#2957 @tunetheweb - Bug: L042 modifies parse tree even during "lint" #2955 @barrywhart
- Allow multiple post function clauses in Postgres and Redshift #2952 @aviv
- Fix bug in L022 for trailing comments in CTE #2946 @tunetheweb
- More dialect checking, fixes, inheritance cleanup #2942 @barrywhart
- T-SQL: Support
OUTPUTParams andGOTOStatements #2949 @tunetheweb - BREAKING CHANGE: change existing dialect name from
spark3tosparksql#2924 @R7L208 - Add Symend to SQLFluff In The Wild #2940 @HeyZiko
- Simplify segment creation and inheritance in dialects #2933 @barrywhart
- Snowflake: Add
ALTER STREAMsupport #2939 @HeyZiko - T-SQL: Handle multiple nested joins #2938 @tunetheweb
- Snowflake: Add
CREATE STREAMsupport #2936 @HeyZiko - T-SQL: Support nested joins #2928 @tunetheweb
- To replace base dialect segment class, must subclass or provide same stuff #2930 @barrywhart
- Add new rule L063 to allow separate capitalisation policy for Datatypes #2931 @tunetheweb
- Adds support for column definitions in table alias expressions #2932 @derickl
- BigQuery: support numeric aliases in
UNPIVOTclauses #2925 @tunetheweb - T-SQL: Supported nested
MERGEstatements #2926 @tunetheweb
New Contributors
- @HeyZiko made their first contribution in #2936
- @aviv made their first contribution in #2952
- @pguyot made their first contribution in #2963
- @dmohns made their first contribution in #2971
- @tcholewik made their first contribution in #2923
- @jmc-bbk made their first contribution in #2981
- @dnim made their first contribution in #3010
- @kd2718 made their first contribution in #3014
- @mrf made their first contribution in #3016
- @zapion made their first contribution in #3031
[0.11.2] - 2022-03-25
What’s Changed
- Added Support For Snowflake Inline Comments #2919 @WittierDinosaur
- Spark3: Fix bug which did not allow multiple joins #2917 @tunetheweb
- Added Snowflake Alter View Support #2915 @WittierDinosaur
- Adjust L010 to ignore nulls and booleans covered by L040 #2913 @tunetheweb
- Fix bug where L043 corrupts SQL #2908 @barrywhart
- Jinja: Add support for Block Assignments #2907 @barrywhart
- L042 fix fails with missing function
get_identifier()on Postgres, Redshift dialects #2899 @barrywhart - BigQuery: Better Set Operators support #2901 @tunetheweb
- Hive: support for complex types in
castrowtypedefinition #2896 @KulykDmytro - Hive: added
jsontype support #2894 @KulykDmytro - Hive: fix incorrect L027 error for rowtype attribute name #2893 @KulykDmytro
- Hive: Add
ARRAYsupport #2891 @tunetheweb - Implemented
PIVOT/UNPIVOTRedshift + Fixed Snowflake Bug + StandardizedPIVOT/UNPIVOTParsing #2888 @PLBMR - Fix AssertionError in dbt templater when file ends with multiple newlines #2887 @barrywhart
- Hive: Row typecasting in
castfunction #2889 @KulykDmytro - dbt templater should gracefully skip macro files #2886 @barrywhart
- Disable L031 on BigQuery due to complex backtick / project name behavior #2882 @barrywhart
- Documentation: Update dbt templater docs with more detail about pros and cons #2885 @barrywhart
- BigQuery: Better
STRUCTArray Support #2881 @tunetheweb - L042: Detect violations when column is templated #2879 @barrywhart
- Improve parsing of
BETWEENstatements #2878 @MarcAntoineSchmidtQC
[0.11.1] - 2022-03-17
Highlights
Major changes include:
- A number of changes to
fixcode to make these more robust - Improvements to templating blocks
generate_parse_fixture_ymloptions to allow quicker, partial regeneration of YML files- Numerous rule fixes including adding auto fix to L042
- Numerous grammar changes
What’s Changed
- Spark3: Support for
SHOWstatements #2864 @R7L208 - Add Markerr to list of organizations using SQLFluff in the wild #2874 @kdw2126
- Refactor JinjaTracer: Split into two classes, break up
_slice_template()function #2870 @barrywhart - BigQuery: support Parameterized Numeric Literals #2872 @tunetheweb
- L042 autofix #2860 @OTooleMichael
- Redshift: transaction statement #2852 @rpr-ableton
- JinjaTracer fix for endif/endfor inside "set" or "macro" blocks #2868 @barrywhart
- L009: Handle adding newline after
{% endif %}at end of file #2862 @barrywhart - Redshift: Add support for
AT TIME ZONE#2863 @tunetheweb - L032 bug fix and fix improvement #2859 @OTooleMichael
- Refactor JinjaTracer; store lex output as individual strings where possible #2856 @barrywhart
- Add ability to regenerate subsets of fixture YAMLs (by dialect, or new only) #2850 @OTooleMichael
- Fix bug with Jinja and dbt
{% set %}blocks #2849 @barrywhart - Bug fix:
ValueError: Position Not Found for lint/parse/fixin JinjaTracer #2846 @barrywhart - Reduce unnecessary setting run ci #2847 @zhongjiajie
- Spark3: statements to
SETandRESETspark runtime configurations #2839 @R7L208 - BigQuery - prevent L006 flagging hyphenated table references #2842 @tunetheweb
- T-SQL fix
CONVERTfunction definition #2843 @tunetheweb - Change rule test script from bash to python #2840 @OTooleMichael
- Spark3: Support
DESCRIBEstatement #2837 @R7L208 - Spark3: Refactor
REFRESHstatements into one class #2838 @R7L208 - Prevent rules incorrectly returning conflicting fixes to same position #2830 @barrywhart
- Redshift and BigQuery: Update dateparts values and functions #2829 @rpr-ableton
- MySQL add
NOWsupport #2825 @tunetheweb - MySQL
DELETE FROMsupport #2823 @tunetheweb - Rule L059 bug with
IF#2824 @tunetheweb - Prevent exceptions when running
fixon dialect fixtures #2818 @tunetheweb - Spark3: Support to handle
CACHEANDUNCACHEauxiliary statements #2814 @R7L208 - Fix L036 error on
CREATE VIEW AS SELECT#2816 @tunetheweb - Fixes for the new post-fix parse check #2813 @barrywhart
- Add initial
MERGEsyntax to most dialects #2807 @PhilippLange - Automated tests should fail if a lint fix introduces a parse error #2809 @barrywhart
New Contributors
[0.11.0] - 2022-03-07
Highlights
Major changes include:
- Changes rule L030 to use
extended_capitalisation_policyto support PascalCase BREAKING CHANGE - Fixes dbt error on ephemeral models
- Log warnings for fixes that seem to corrupt the parse SQL as may cause incorrect fixes in other rules.
- Bug fix to rule L011 for
implicitaliases - Bug fix to rule L019 for commas besides templated code
- Rule L051 can now optionally be applied to
LEFT/RIGHT/OUTER JOINs - Improvements to Test Suite
- Many dialect improvements
What’s Changed
- Exasol: Fix
INTERVALliterals / expression #2804 @sti0 - Exasol: Add
IDLE_TIMEOUTandSNAPSHOT_MODE#2805 @sti0 - Exasol: Support value range clause within
INSERTstatements (7.1+) #2802 @sti0 - Exasol: Add lua adapter scripts (7.1+) #2801 @sti0
- Exasol: Add openid support for create/alter user (7.1+) #2800 @sti0
- Exasol: New consumer group params and unreserved keywords (7.1+) #2799 @sti0
- Snowflake: Complete
INSERTgrammar #2798 @jpy-git - Fix Postgres
VALUES, make Spark3VALUESconsistent #2797 @jpy-git - Postgres:
INSERT DEFAULTvalue #2796 @jpy-git - Postgres: Make
ASoptional in PostgresDELETE#2794 @jpy-git - BigQuery support
UNESTaliases #2793 @tunetheweb - Postgres: Add all range operators #2789 @jpy-git
- Snowflake: Complete
DELETE FROMgrammar #2792 @jpy-git - Postgres: Complete
DELETE FROMgrammar #2791 @jpy-git - Postgres: Add
RETURNINGgrammar toINSERT INTOstatement #2790 @jpy-git - Snowflake: Complete
PATTERNgrammar #2788 @jpy-git - Redshift: add
[ALTER/CREATE/DROP] PROCEDUREsegments #2774 @rpr-ableton - Spark3: Support for
ANALYZE TABLEstatement #2780 @R7L208 - Snowflake: Add
MATCH_RECOGNIZEclause #2781 @jpy-git - Snowflake: Complete
LIMITgrammar #2784 @jpy-git - Rough autofix for L028 #2757 @OTooleMichael
- Spark3 bug: Create with complex data types (#2761) #2782 @PhilippLange
- Snowflake: Complete
LIKEgrammar #2779 @jpy-git - Spark3: Auxiliary
FILEandJARstatements #2778 @R7L208 - Snowflake: Refine
SET/UNSETMASKING POLICYgrammar #2775 @jpy-git - L049 bug: correct over zealous
=-->IS#2760 @OTooleMichael - Make extension case insensitive #2773 @tunetheweb
- Snowflake: Add dollar quoted string literal #2770 @jpy-git
- Bug fix: L036 corrupts
SELECT DISTINCT idquery #2768 @barrywhart - Snowflake: Add
CHANGESclause #2764 @jpy-git - Spark3: Support for
EXPLAINstatement #2767 @R7L208 - Snowflake: Add
CONNECT BYclause #2763 @jpy-git - Spark3: Support for
TRANSFORMclause #2762 @R7L208 - Snowflake: Fix
GROUP BY {CUBE|ROLLUP|GROUPING SETS}parsing #2759 @jpy-git - BigQuery: allow identifiers starting with dash #2756 @tunetheweb
- Add
ignore_wordsoptions to L057 and L059 #2753 @tunetheweb - L012 bug fix for T-SQL alternative alias types #2750 @tunetheweb
- Spark3: Support for
PIVOTclause #2752 @R7L208 - Update Redshift reserved keywords list #2751 @rpr-ableton
- L007 autofix #2735 @OTooleMichael
- L032 fixable in easy cases #2737 @OTooleMichael
- Fix dbt templater runtime error in
inject_ctes_into_sql()#2748 @barrywhart - L059: Exasol: Allow quotes around passwords in
CREATE USER#2744 @sti0 - Improve docs for
load_macros_from_path#2743 @barrywhart - Make L045 (Query defines a CTE but does not use it) case insensitive #2746 @barrywhart
- Add L049 test for T-SQL alternate alias syntax (
=) #2745 @barrywhart BaseSegment.pos_markeris typed as non optional but sometimes set toNone#2741 @barrywhart- Support Pascal case for L030 #2739 @tunetheweb
- Postgres, Redshift: Support
SIMILAR TOpattern matching expressions #2732 @PLBMR - Forgive shorthand cast only / bracket only expressions from L013 #2729 @OTooleMichael
- L052: Refactor
_eval()into individual functions to improve readability #2733 @barrywhart - L018: Move closing parenthesis to next line #2734 @barrywhart
- Improve rule yaml tests: assert that
fix_strpasses the rule #2624 @juhoautio - Extend rule L051 to
LEFT/RIGHT/OUTERJOINs #2719 @rpr-ableton - T-SQL: Allow aliases with
=#2727 @fdw - T-SQL: Support table variables #2728 @fdw
- Support for checking violations in YAML rule tests #2718 @juhoautio
- Roll back PR #2610 #2726 @barrywhart
- Redshift: Allow whitespace around cast operators #2721 @PLBMR
- Support database links in Oracle #2725 @tunetheweb
- Rule L019: Ignore comma placement violations if the adjacent code is templated #2717 @barrywhart
- T-SQL: Add drop constraint syntax #2724 @fdw
- ANSI: Support optionally bracketed CTE #2716 @OTooleMichael
- Spark3: Test cases for
CASEclause #2714 @R7L208 - Spark3: Support for
WINDOWfunctions #2711 @R7L208 - T-SQL: Add variables as options for
RAISERRORparameters #2709 @jpers36 - T-SQL: Add
OPTIONclause toUPDATE#2707 @jpers36 - Spark3: Test cases for
WHEREclause #2704 @R7L208 - Spark3: test cases for Table-Valued Functions #2703 @R7L208
- T-SQL: Allow for optionally bracketed
PARTITION BYelements #2702 @jpers36 - T-SQL: Fix
SET TRANSACTION ISOLATION LEVELparsing #2701 @jpers36 - Migrate tricky L004 tests to python #2681 @juhoautio
- Core linter enhancement: Check for successful parse after applying fixes #2657 @barrywhart
- Spark3: Support for
LATERAL VIEWclause #2687 @R7L208 - Document python requirement for tox/mypy & remove basepython from conf #2644 @juhoautio
- Fix rule L011 for implicit aliases #2683 @tunetheweb
- Pin markupsafe to prevent CI failures #2685 @tunetheweb
- Exasol: Allow
CROSSjoins #2680 @sti0 - Exasol: Improve function formatting #2678 @sti0
- T-SQL: Add indentation for
CREATEINDEX/STATISTICS#2679 @jpers36 - Spark3: Support for
TABLESAMPLEclause #2674 @R7L208 - T-SQL: Improve
RAISERRORfunctionality #2672 @jpers36 - Snowflake dialect update for
MERGE INTOpredicates #2670 @The-Loud - Assert that fix_str is set #2663 @juhoautio
New Contributors
- @The-Loud made their first contribution in #2670
- @OTooleMichael made their first contribution in #2716
- @PhilippLange made their first contribution in #2782
[0.10.1] - 2022-02-15
Highlights
Major changes include:
- Improvements to rules L023, L045, L048, L052, L059 to make them more accurate.
- If
sqlfluff fixcannot find a stable fix afterrunaway_limititerations (default 10) then no fixes will be applied. - Addition of
--write-outputconfig to command line so prevent errors corrupting output. - Various dialect improvements
What’s Changed
- Redshift: Support DATETIME as a valid datatype #2665 @PLBMR
- Support L033 for RedShift #2661 @tunetheweb
- Fix parsing types and add check to test in future #2652 @tunetheweb
- Spark3: Support for
SORT BYClause #2651 @R7L208 - Migrate issue template from markdown to yaml #2626 @zhongjiajie
- L048 - handle more statements and exclude casting operators #2642 @tunetheweb
- MySQL support
CURRENT_TIMESTAMP()inCREATE TABLE#2648 @tunetheweb - Postgres enhanced
DELETE FROMsyntax #2643 @tunetheweb - Bug fix: L025 should consider BigQuery
QUALIFYclause #2647 @barrywhart - Bug fix: L025 overlooking
JOIN ONclause if join expression in parentheses #2645 @barrywhart - L045 not reporting unused CTEs if the query uses templating #2641 @barrywhart
- Fix IndexError in L001 #2640 @barrywhart
- L052: If require_final_semicolon is set, ensure semicolon after ALL statements #2610 @barrywhart
- L023 to also fix extra newlines in CTE #2623 @juhoautio
- Spark3: Enhancements for Set Operators #2622 @R7L208
- Doc a better choice for default env #2630 @juhoautio
- Ensure ordering of fix compatible and config in rules docs #2620 @zhongjiajie
- Pin python version for tox -e mypy #2629 @juhoautio
- Hitting the linter loop limit should be treated as an error #2628 @barrywhart
- Allow file output directly from cli #2625 @alanmcruickshank
- BigQuery
UNPIVOTandPIVOTfixes #2619 @tunetheweb - L059 quoted identifiers bug #2614 @tunetheweb
- Snowflake dialect: Adjust snowflake array access #2621 @alanmcruickshank
- Spark3: Test Cases for
ORDER BYinSELECT#2618 @R7L208 - Fix typos in 0.10.0 changelog #2605 @tunetheweb
- T-SQL: Indent
IFclause expression segments #2615 @jpers36 - Spark3: Enhancements for
LIMITClause #2612 @R7L208 - Allow Bare Functions in column constraints #2607 @tunetheweb
- Add Oracle at and double at sign (execution symbol) #2608 @r0fls
- Spark3: Enhancements to
LIKEclause #2604 @R7L208
[0.10.0] - 2022-02-10
Highlights
Major changes include:
- Dropping support of DBT < 0.20 BREAKING CHANGE
sqlfluff fixno will no longer fix SQL containing parsing or templating errors BREAKING CHANGE- New rule L062 to allow blocking of list of configurable words (e.g. syntax, or schemas, or tables you do not want people to use)
- Lots and lots of docs improvements
- Looser requirements for
clickpython package
What’s Changed
- L046: Detect Jinja spacing issues where segment begins with literal content #2603 @barrywhart
- MySQL Add BINARY support #2602 @tunetheweb
- Support indenting WINDOWS clauses and (optionally) CTEs #2601 @tunetheweb
- Postgres: Support expressions in arrays #2599 @tunetheweb
- BigQuery support Array of Structs #2598 @tunetheweb
- Support wildcards in triggers #2597 @tunetheweb
- Support CTEs in CREATE VIEW statements #2596 @tunetheweb
- SQLite Support more CREATE TRIGGER options #2594 @tunetheweb
- Snowflake: Support Column Comments in Alter Table statements #2593 @tunetheweb
- Redshift: Add DATETIME as reserved keyword #2591 @tunetheweb
- Support LIMIT and ORDER BY clauses in Values clauses #2590 @tunetheweb
- L016: New option "ignore_comment_clause" to ignore column COMMENTs, etc. #2589 @barrywhart
- Bug fix: L016 ("Line is too long") should consider length of prior fixes #2587 @barrywhart
- Add mysql INSERT ON DUPLICATE KEY #2494 @rpr-ableton
- Snowflake ALTER TABLE: Add multiple columns #2578 @erevear
- MySQL: UNIQUE KEY in CREATE TABLE #2525 @jpy-git
- Spark3: JOIN clause enhancements #2570 @R7L208
- Bug fix: L003 should fix indentation for templated code #2580 @barrywhart
- Exasol: Improve
COMMENTandWITH [NO] DATAclause usage. #2583 @sti0 - Exasol: Allow multiple
LOCALkeywords inWHEREclause #2582 @sti0 - Exasol: Allow
LOCALkeyword withinPREFERRINGclause #2579 @sti0 - Add/Improve docs for config settings: "ignore", "ignore_templated_areas" #2574 @barrywhart
- Look for .sqlfluffignore in current directory #2573 @barrywhart
- Snowflake: L054 should ignore "WITHIN GROUP" clauses #2571 @barrywhart
- Redshift: Support Redshift SUPER Data Types #2564 @PLBMR
- Capitalization rules (L010, L014, L030, L040) should ignore templated code #2566 @barrywhart
- T-SQL: Add Frame clause unreserved keywords #2562 @jpers36
- Simple API: Fix bug where omitted parameters still override .sqlfluff #2563 @barrywhart
- Spark3: Add Direct File Query #2553 @R7L208
- Redshift dialect: replace AnyNumberOf with AnySetOf where it makes sense #2561 @rpr-ableton
- jinja and dbt templaters: More robust handling of whitespace control #2559 @barrywhart
- Improve how "sqlfluff fix" handles templating and parse errors #2546 @barrywhart
- Jinja and dbt templater: Fix "list index out of range" error #2555 @barrywhart
- Fix typo in sqlfluffignore docs #2551 @tunetheweb
- Correct parsing for BigQuery
SELECT REPLACEclauses. #2550 @elyobo - Rules documentation improvements #2542 @tunetheweb
- Remove requirement for Click>=8 #2547 @tunetheweb
- Allow L059 to be configured to always prefer quoted identifiers #2537 @niconoe-
- Adds new rule L062 to allow blocking of certain words #2540 @tunetheweb
- Update to latest Black, drop support for dbt < 0.20 #2536 @barrywhart
- dbt templater: Fix bug where profile wasn't found if DBT_PROFILES_DIR contained uppercase letters #2539 @barrywhart
- Spark3: Added segments & grammar needed for hints #2528 @R7L208
- Spark3: parse some VALUES clauses #2245 @mcannamela
- T-SQL: Allow multiple params in SET statements #2535 @tunetheweb
- T-SQL: Add indentation for SET statement #2531 @jpers36
- Add additional documentation on dbt-adapter in pre-commit #2530 @robertdefilippi
- T-SQL: Add indentation for UPDATE statement #2532 @jpers36
- Fix Snowflake Unordered Select Clause #2529 @tunetheweb
- Fix Quoted Literals for Postgres and Redshift affecting rule L039 #2526 @tunetheweb
- Postgres specific CTEDefinitionSegment #2524 @jpy-git
New Contributors
- @robertdefilippi made their first contribution in #2530
- @niconoe- made their first contribution in #2537
- @elyobo made their first contribution in #2550
- @erevear made their first contribution in #2578
[0.9.4] - 2022-01-30
Highlights
Major changes include:
- dbt performance improvements
- Fix
clickdependency error. - Better datepart versus identifier parsing.
- Fix some Jinja errors.
- Various grammar fixes and improvements
What’s Changed
- Spark3: test cases for HAVING clause in SELECT statement #2518 @R7L208
- Update click version requirement in setup.cfg to match that in requirements.txt #2518 @barrywhart
- Postgres: Implement DO Statements + Refactored Language Clause #2511 @PLBMR
- Spark3: Support for Grouping Sets,
CUBEandROLLUPinGROUP BYclause ofSELECTstatement #2505 @R7L208 - Refactor date part functions #2510 @tunetheweb
- Postgres: EXPLAIN ANALYSE allows British spelling #2507 @jpy-git
- "noqa": Add support for ignoring template (TMP) and parse (PRS) errors #2509 @barrywhart
- Freeze Black due to incompatibility between 22.1 and flake8-black #2513 @tunetheweb
- Support NATURAL JOINS #2506 @tunetheweb
- dbt Docker environment: Mount the test profiles.yml at ~/.dbt #2502 @barrywhart
- Add dbt_artifacts package to in the wild docs #2504 @NiallRees
- Spark3: Support
DISTRIBUTE BYclause inSELECTstatement #2503 @R7L208 - dbt templater: For performance reasons, cache the database connection across models #2498 @barrywhart
- Bug fix: Defining and using Jinja macro in the same file causes runtime error #2499 @barrywhart
- Spark3: Support
CLUSTER BYclause inSELECTstatement #2491 @R7L208 - Grammar: Adds support for COPY statement for Postgres dialect #2481 @derickl
- Add raiserror for T-SQL #2490 @fdw
- Enforce parentheses for function definitions in T-SQL #2489 @fdw
- Add guards to prevent rule crashes #2488 @barrywhart
New Contributors
[0.9.3] - 2022-01-26
Highlights
Major changes include:
- Add
ignore_wordsoption for rules L010, L014, L029, L030, L040 - Fix some issues in 0.9.2 preventing some queries linting
What’s Changed
- Prevent L031 throwing exception on unparsable code #2486 @tunetheweb
- Add linting of fixtures SQL for critical rules errors to tox #2473 @tunetheweb
- Fix L039 for T-SQL comparison operator using space #2485 @tunetheweb
- Fix bug in get_alias causing rule Critical errors for T-SQL #2479 @tunetheweb
- Tweak GitHub templates #2471 @tunetheweb
- Small speed improvement to L054 #2476 @tunetheweb
- L003: Revisit recent change to improve speed #2474 @barrywhart
- Fix select_crawler issue with some Exasol statements #2470 @tunetheweb
- Cleanup date logic by removing DatePartClause and using DatetimeUnitSegment instead #2464 @tunetheweb
- Fix L044 exception when final statement has no SELECT #2468 @tunetheweb
- Support T-SQL system variables (e.g. @@rowcount) #2463 @tunetheweb
- Add base rule to developing rules page #2462 @tunetheweb
- L003: Ignore indentation of lines that only exist in templated space #2460 @barrywhart
- Ignore words for various rules #2459 @tunetheweb
- Support Foreign Key options for MySQL #2461 @tunetheweb
- Exclude WINDOW clauses from L054 #2455 @tunetheweb
- Fix bug with L026 for simple deletes #2458 @tunetheweb
- Spark3: test cases for Common Table Expressions #2454 @R7L208
- Fix T-SQL's IDENTITY_INSERT syntax #2452 @fdw
- T-SQL: Support stored procedures in insert statements #2451 @fdw
- Spark3: Support for
LOAD DATAstatements #2450 @R7L208
[0.9.2] - 2022-01-24
Highlights
We are pleased to include 110 improvements and fixes in this release, and welcome 7 new contributors to the code.
Major changes include:
- Initial Oracle support (note: SQL, but not PL/SQL)
- Fix more dbt 1.0.0 connection issues
- Improved configuration documentation
- New rule (L059) to flag unnecessary quoted identifiers
- New rule (L060) to prefer
COALESCEinstead ofIFNULLorNVL - New rule (L061) to prefer
!=over<> - Many rule fixes
- Many dialect improvements
What’s Changed
- Add Postgres DROP PROCEDURE support #2446 @rpr-ableton
- MySQL Alter table ADD/DROP/RENAME INDEX support #2443 @tunetheweb
- Add basic CREATE PROCEDURE support to Postgres #2441 @tunetheweb
- Indent T-SQL DECLARE and EXEC statements #2439 @tunetheweb
- Hive alternative types: INTEGER, DEC, NUMERIC #2438 @tunetheweb
- Implement Snowflake Dateparts #2437 @tunetheweb
- Fix rule L028 for T-SQL for params #2442 @tunetheweb
- Support CREATE UNIQUE INDEX #2440 @tunetheweb
- Make BigQuery typeless STRUCTs Expressions #2435 @tunetheweb
- T-SQL support default params and no RETURN value #2434 @tunetheweb
- "sqlfluff fix" should report any parse errors found #2423 @barrywhart
- Redshift VACUUM support #2433 @rpr-ableton
- Add Oracle PROMPT statement #2413 @r0fls
- Spark3: Support for
INSERT OVERWRITE DIRECTORYwith Hive Format #2389 @R7L208 - Exasol: Fix escaped identifiers #2431 @sti0
- Exasol: Fix
LOCAL.ALIASSyntax #2430 @sti0 - Exasol: Allow quoted identifier for various statements. #2428 @sti0
- Misc grammar improvements for Snowflake #2421 @chwiese
- New rule L061 to use != over <> #2409 @sti0
- Correct TRANS to TRAN #2425 @fdw
- Remove the "heuristic" slicer, as it was replaced by JinjaTracer #2422 @barrywhart
- L060: More specific description #2419 @jpy-git
- Fix code formatting in Rule docs #2418 @tunetheweb
- Allow UPDATE SET statements in RedShift #2417 @tunetheweb
- Add Redshift cursor DECLARE, FETCH & CLOSE support #2414 @rpr-ableton
- Add Redshift ANALYZE COMPRESSION support #2412 @rpr-ableton
- ANSI Values statement fixes #2404 @jpy-git
- Exasol: Overhaul drop statements #2407 @sti0
- L044, L045: Handle Exasol VALUES clause #2400 @barrywhart
- L060: Use COALESCE instead of IFNULL or NVL. #2405 @jpy-git
- Postgres: Fix Values alias regression #2401 @jpy-git
- Align line length in Python code to 88 characters #2264 @chwiese
- Jinja templater: Allow "load_macros_from_path" to be a comma-separated list of paths #2387 @barrywhart
- Add "TRANS" keyword for T-SQL #2399 @fdw
- Docstrings: Replace double backticks with single quote for lint results. #2386 @jpy-git
- Spark3: Support for
INSERT OVERWRITE DIRECTORYstatements #2385 @R7L208 - Fix unnecessary white underline in doc site #2383 @tunetheweb
- Rolls back some code cleanup that caused coverage report to show gaps #2384 @barrywhart
- Fix "connection already closed" issue with dbt 1.0 and dbt_utils #2382 @barrywhart
- Spark3: Support for
INSERT [TABLE]data manipulation statements #2290 @R7L208 - Comment out line in bug report template #2378 @jpy-git
- Postgres: EXPLAIN statement updates #2374 @jpy-git
- Make TABLE a non-reserved word in Postgres #2377 @tunetheweb
- Snowflake COLUMN is not a reserved word #2376 @tunetheweb
- T-SQL: Complete ASA Table Index Clause functionality #2373 @jpers36
- Add support for Jinja import and include #2355 @barrywhart
- Add Redshift INTERVAL datatype support #2366 @rpr-ableton
- Whitespace concatenated string literals for MySQL, Postgres and Redshift #2356 @jpy-git
- Fix L026 false positive on "SELECT INTO" statement #2371 @barrywhart
- Exclude EMIT clauses from rule L013 #2364 @tunetheweb
- Functional API: Segments.recursive_crawl #2369 @jpy-git
- Complete Redshift CREATE EXTERNAL TABLE support #2354 @rpr-ableton
- L041: Fix duplicate DISTINCT corruption #2365 @jpy-git
- Bigquery Create View with Options #2359 @tunetheweb
- L026: Handle DML statements and multiple levels of nesting #2336 @barrywhart
- Postgres & MySQL: cleanup AliasExpressionSegment #2353 @jpy-git
- Redefine MySQL Interval segment #2351 @rpr-ableton
- Postgres: INSERT INTO table alias #2349 @jpy-git
- L043: Remove redundant CASE statement replacing NULLS with NULLS #2346 @jpy-git
- Add RedShift DATASHARE support #2350 @rpr-ableton
- Various documentation updates #2347 @tunetheweb
- Snowflake ALTER TABLE: Drop multiple columns #2348 @jpy-git
- Configuration doc: add rule configuration section #2291 @juhoautio
- Redshift: create model, show model & data types #2338 @rpr-ableton
- L059: Unnecessary quoted identifier #2341 @jpy-git
- L043: Use simple replace to apply fixes #2343 @jpy-git
- T-SQL: Add functionality to PARTITION BY clause #2335 @jpers36
- L039 casting operator postgres fix #2334 @jpy-git
AnySetOfgrammar #2326 @jpy-git- Redshift: update CREATE TABLE AS match_grammar #2333 @rpr-ableton
- Redshift CREATE EXTERNAL TABLE: TABLE PROPERTIES #2330 @jpy-git
- Snowflake: Flush out
ALTER TABLE'stableColumnActiongrammar #2332 @wong-codaio - Snowflake ALTER TABLE: Add clusteringAction #2329 @jpy-git
- Snowflake ALTER TABLE: Add searchOptimizationAction #2328 @jpy-git
- Fix numeric literal grammar for Postgres/MySQL/Exasol #2324 @jpy-git
- L039: Remove spaces between comparison operators (T-SQL) #2325 @jpy-git
- Enable setting a target of a dbt profile #2236 @yu-iskw
- Snowflake: Add support for column rename #2327 @wong-codaio
- Snowflake: Added
AlterTableStatementspecific for Snowflake #2267 @wong-codaio - Full REFERENCES grammar for CREATE TABLE statement #2315 @jpy-git
- Fix Spark numeric literals #2317 @jpy-git
- Change type of Snowflake stage paths to fix issues with L044 #2320 @chwiese
- Add Bytes Quoted Literals to Spark dialect #2312 @jpy-git
- Fix L044 assertion failure with delete stmt & cte #2321 @barrywhart
- L003 should consider only literal leading whitespace (ignore templated) #2304 @barrywhart
- Redshift: update reserved keywords #2318 @rpr-ableton
- docs: Document how to run SQLFluff with local changes to test them #2316 @kayman-mk
- Update redshift unreserved keywords #2310 @jpy-git
- Fix spark and hive quoted literals #2311 @jpy-git
- Oracle Dialect #2293 @r0fls
- Redshift dialect: add COPY and UNLOAD statements #2307 @rpr-ableton
- L052: Fix case where no preceding segments and mulitline #2279 @jpy-git
- Update rule L049 to handle EXEC assignments #2308 @tunetheweb
- Remove DATE, DATETIME and TIME from BigQuery DatePart #2283 @tunetheweb
- Fix #1292: nocolor and verbose can work in config files #2300 @cympfh
- Allow pyproject.toml as extra_config_path #2305 @jpy-git
- L009: Handle adding newline after trailing templated code #2298 @barrywhart
- added missing "t" in doc for Rule_L020 #2294 @Xilorole
- docs: Document configuration keyword for rule L054 #2288 @tomasfarias
- Update L009 to operate in raw, not templated space #2285 @barrywhart
- Redshift CREATE LIBRARY statements #2277 @rpr-ableton
- L025 with 'bigquery' dialect: Correctly interpret calling functions with a table as a parameter #2278 @barrywhart
- Spark3: Coverage for
REFRESHauxiliary statements #2282 @R7L208 - Spark3: Coverage for
USE DATABASEstatement. #2276 @R7L208 - Fix link for editing 'In The Wild' page with new base branch,
main#2280 @barnett - Optionally allow additional configurable characters in L057 #2274 @tunetheweb
- L025 should look at subqueries #2273 @barrywhart
- Add coverage for
TRUNCATEstatement in Spark3 dialect #2272 @R7L208 - Upgrade
clickversion to 8.0+ to supportclick.shell_completion#2271 @wong-codaio - Improve release checklist to make releases easier #2263 @tunetheweb
New Contributors
- @barnett made their first contribution in #2280
- @tomasfarias made their first contribution in #2288
- @Xilorole made their first contribution in #2294
- @cympfh made their first contribution in #2300
- @r0fls made their first contribution in #2293
- @yu-iskw made their first contribution in #2236
- @fdw made their first contribution in #2399
[0.9.1] - 2022-01-08
Highlights
- Fix dbt 1.0.0 connection issue
- Fix some SQL corruption issues with templated code
- New components to simplify creating rules
- Remove support for Python 3.6
What’s Changed
- Fix delimited identifier parsing for spark3 #2111 @mcannamela
- Stop numeric literal from splitting valid naked identifiers. #2114 @jpy-git
- Grammar: Add CREATE USER/GROUP statement to Redshift dialect #2115 @jpy-git
- Fix mypy type raise in L003 #2127 @barrywhart
- Add ability to parse multiple GO/semicolon delimiters #2124 @jpy-git
- Allowed array/struct values in
defaultdefinition ofdeclare#2120 @KulykDmytro - Normalise input newlines #2128 @jpy-git
- Clean up all files using the pre-commit hook #2123 @kayman-mk
- Refined LintFix API #2133 @jpy-git
- Hotfix for LintFix comparisons #2138 @jpy-git
- Lint spaces in qualified names #2130 @jpers36
- Remove support for Python 3.6 (it's "end of life" December 23, 2021) #2141 @barrywhart
- Fully remove python3.6 references #2142 @jpy-git
- Fix L022 to not flag CTE column definitions #2139 @jpy-git
- docs: set
dbt_modulestodbt_packages#2143 @ciklista - Hive: add INTERVAL syntax #2144 @juhoautio
- Fix mypy error on python 3.7 #2147 @juhoautio
- Update PR template to reference tox generate-fixture-yml command #2148 @jpy-git
- Update index.rst notable changes with 0.9.0 details #2132 @jpy-git
- Add ALTER USER and ALTER GROUP to redshift dialect #2131 @jpy-git
- Add complete DESCRIBE grammar to Snowflake dialect #2149 @jpy-git
- Fix bug with BigQuery UNPIVOT #2156 @tunetheweb
- Make L057 compatible with BigQuery #2151 @tunetheweb
- T-SQL: Proper Indentation of ELSE IF #2157 @jpers36
- Linter Test Name Duplication #2158 @jpers36
- Add struct support for
hiveandredshift(L026, L028) #2154 @KulykDmytro - Postgres - Support functions prepended with _ and containing $ #2159 @jpy-git
- T-SQL: function parsing/linting #2155 @jpers36
- T-SQL: Add THROW statement #2163 @jpers36
- Add yamllint to project #2162 @tunetheweb
- Fix outdated docstring in dialects_test #2166 @juhoautio
- Minor comment fixes #2179 @juhoautio
- L010 to apply to date_part (capitalization policy for time units) #2167 @juhoautio
- ALTER GROUP fix to accommodate quoted objects #2188 @tdstark
- Lexer: add non-breaking spaces to whitespace #2189 @jpers36
- Grammar: Add COMMENT statement to Snowflake #2173 @jpy-git
- Grammar: Add DISCARD statement to Postgres dialect #2175 @jpy-git
- Grammar: Add UNDROP statement to Snowflake dialect #2177 @jpy-git
- Grammar: Add UNSET statement to Snowflake dialect #2181 @jpy-git
- Grammar: Add RESET statement to Postgres dialect #2182 @jpy-git
- Grammar: Add LOAD statement to Postgres dialect #2183 @jpy-git
- Grammar: Fix TRUNCATE statement in Snowflake dialect #2184 @jpy-git
- Grammar: Add HELP statement to MySQL dialect #2191 @jpy-git
- Grammar: Add PURGE BINARY LOGS statement to MySQL dialect #2193 @jpy-git
- Grammar: Add RESET MASTER statement to MySQL dialect #2194 @jpy-git
- Grammar: Add RENAME TABLE statement to MySQL dialect #2195 @jpy-git
- Grammar: Tidy up transaction statements in Snowflake dialect #2196 @jpy-git
- Modifying Redshift USER/GROUP Statements To Use
ObjectReferenceSegment#2190 @tdstark - Grammar: Fix TRUNCATE statement in Postgres dialect #2185 @jpy-git
- Grammar: Add LISTEN, NOTIFY, and UNLISTEN statements to Postgres dialect #2174 @jpy-git
- Grammar: Tidy up Snowflake/MySQL/HIVE USE statements #2187 @jpy-git
- Make Snowflake keywords unreserved: account, organization, pivot #2172 @jpy-git
- Grammar: Add SET sql_log_bin statement to MySQL dialect #2192 @jpy-git
- Grammar: Add CALL statement to Snowflake dialect #2176 @jpy-git
- L027 Fix self referring column alias edge case #2171 @jpy-git
- T-SQL: Remove dependency on ANSI keyword lists #2170 @jpers36
- Grammar: Add Table Maintenance Statements to MySQL dialect #2198 @jpy-git
- Adding CREATE TABLE AS to Redshift #2205 @tdstark
- T-SQL: Add support for ALTER TABLE ALTER COLUMN #2208 @jpers36
- Remove oyaml in favour of pyyaml #2210 @jpy-git
- Support Spark
CREATE TABLE LIKEsyntax #2207 @R7L208 - Add override for linguist to include SQL in language statistics #2214 @jpy-git
- Add type stubs for appdirs and colorama to improve mypy coverage #2211 @jpy-git
- Remove cached-property in favour of stdlib functools implementation #2212 @jpy-git
- Restructure CASE segment (extract WHEN and ELSE into their own segment types) #2213 @barrywhart
- Add types-regex package for type checking #2216 @jpy-git
- Snowflake: Split out
CREATE VIEWinto its own segment #2217 @wong-codaio - Grammar: Fix multi-character comparison operators #2197 @jpy-git
- Snowflake: Support TOP N select clause modifier #2222 @wong-codaio
- Fix CLI arguments to allow for autocompletion #2218 @jpy-git
- Simplify rule creation by adding a functional API to RuleContext #2126 @barrywhart
- Simplify nested cases #2223 @barrywhart
- Reword lint message for L058 per review #2226 @barrywhart
- Update BaseRule.discard_unsafe_fixes() to avoid touching templated code #2220 @barrywhart
- Add L059 - Capitalization on Data Types #2227 @tdstark
- T-SQL: Table valued functions #2233 @jpers36
- Don't allow fixes to COPY code from templated regions #2231 @barrywhart
- Fix several small issues with rule docs #2234 @barrywhart
- postgres: Add datatypes #2121 @kayman-mk
- Combine L059 and L010 #2238 @tdstark
- Fix L044 assertion failure: "SELECT *" with no "FROM" clause #2239 @barrywhart
- Docs: Make Specific Rules docstring more user friendly #2241 @jpy-git
- Fix a bug handling Jinja "{% set %}" blocks with a templated block inside #2240 @barrywhart
- Redshift lint create external table statements #2229 @tinder-albertyue
- Update tox.ini for best practices #2243 @jpy-git
- Docs: Make code blocks consistent #2242 @jpy-git
- Add support for nested Jinja macros #2246 @barrywhart
- Support
DROPDDL statements for Spark3 #2215 @R7L208 - Docker Compose environment for SQLFluff developers #2254 @barrywhart
- T-SQL: Add OFFSET unreserved keyword #2258 @jpers36
- Fix connection issue in dbt 1.0.0 #2230 @NiallRees
- Redshift CREATE SCHEMA statements #2252 @rpr-ableton
- Enhance Snowflake COPY INTO #2250 @chwiese
- Coverage for 'REPAIR' Statements for Hive & Spark3 dialect #2256 @R7L208
New Contributors
- @mcannamela made their first contribution in #2111
- @ciklista made their first contribution in #2143
- @juhoautio made their first contribution in #2144
- @tinder-albertyue made their first contribution in #2229
- @rpr-ableton made their first contribution in #2252
[0.9.0] - 2021-12-13
What’s Changed
This release brings about several great new additions including:
- dbt 1.0.0 compatibility.
- CLI and Simple API parameters 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
- T-SQL: 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
- T-SQL dialect: add parsing for MERGE statement #2057 @tkachenkomaria244
- Simple API config path #2080 @jpy-git
- dbt 1.0.0 compatibility #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
- T-SQL: INSERT INTO #2054 @jpers36
- Add --disable-noqa option to CLI and config #2043 @jpy-git
- T-SQL: 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- T-SQL (ASA): Allow for table identifier in DELETE clause #2031 @jpers36
- T-SQL (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
- T-SQL: 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 unnecessary 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
[0.8.2] - 2021-11-22
What’s Changed
One of the biggest new features in this release is the support for SQLAlchemy and other "placeholder" templating within SQL queries. Check out the documentation on how to set it up.
This release also adds seven new rules. Get some help with your leading whitespace, semi-colon placement, inconsistent column references in GROUP BY/ORDER BY, and getting rid of RIGHT JOIN's among other useful lints with our new rules! See our rules documentation for more details.
On top of those, we have made loads of grammar improvements across many dialects, improvements to the dbt templater (including issues where sqlfluff fix would corrupt the code 😱), more fix routines, and lots more improvements.
🚀 Enhancements
- [many dialects] Implement generic placeholder templating #1887 @jacopofar
- [many dialects] Add support for SQLAlchemy templating #1878 @jacopofar
- Add DROP PROCEDURE statement to T-SQL #1921 @jpy-git
- T-SQL dialect: fix index/tables creation options #1955 @tkachenkomaria244
- Add DROP TYPE statement to ANSI dialect #1919 @jpy-git
- Add INSERT INTO statements to Redshift Dialect #1896 @tdstark
- Added TABLESAMPLE support to Bigquery #1897 @WittierDinosaur
- Add [LEFT] ANTI and [LEFT] SEMI joins to the Spark3 dialect #1942 @jpy-git
- Parse UPDATE/INSERT within WITH clause #1889 @jpy-git
- Add OVERRIDING SYSTEM/USER VALUE to insert statement in postgres dialect #1869 @jpy-git
- Add support for DROP SCHEMA [IF EXISTS] name [ CASCADE | RESTRICT ] #1865 @gimmyxd
- Add CREATE TABLE Statement To Redshift #1855 @tdstark
- Add DROP TYPE statement in postgres dialect #1870 @jpy-git
- Add SEQUENCE NAME to postgres sequence options #1866 @jpy-git
- Added SET Statement to Postgres #1877 @WittierDinosaur
- Postgres: Allow use of quoted identifiers to ALTER TABLE OWNER TO #1856 @markpolyak
- Updates to COPY INTO grammar in Snowflake #1884 @WittierDinosaur
- Postgres & T-SQL: Drop Function #1924 @WittierDinosaur
- Add Expressions to SET syntax #1852 @tunetheweb
- Update DbtTemplater to use JinjaTracer #1788 @barrywhart
- L043 refinement: Add autofix for common use of CASE to fill NULL values. #1923 @jpy-git
- New Rule L050: No leading whitespace #1840 @jpy-git
- L050: updating to target jinja templates #1885 @jpy-git
- New rule L051 to forbid lone JOIN #1879 @jpy-git
- New Rule L052: Semi colon alignment #1902 @jpy-git
- New Rule L053: Remove outer brackets from top-level statements. #1916 @jpy-git
- New Rule L054: Inconsistent column references in GROUP BY/ORDER BY clauses. #1917 @jpy-git
- New Rule L055: Use LEFT JOIN instead of RIGHT JOIN. #1931 @jpy-git
- New Rule L056: 'SP_' prefix should not be used for user-defined stored procedures #1930 @jpy-git
- Tsql partition by multiple columns #1906 @jpers36
- Added bare functions to values clause #1876 @WittierDinosaur
- Remove unnecessary context section, from code and the docs #1905 @jacopofar
- L036 docstring refinements #1903 @jpy-git
- Add
exclude_rulesoption for the Simple API #1850 @tunetheweb - Tox improvements: Streamline development/testing environments. #1860 @jpy-git
- Add Tox publish commands #1853 @jpy-git
- Documentation: Change inheritance dialect example to Redshift #1900 @chwiese
- Remove failing requires.io badge #1898 @jpy-git
- [Snowflake] Allow naked AUTOINCREMENT #1883 @gordonhart
- Add support for curly brackets in SnowSQL ampersand variables #1901 @chwiese
- Add short form help option (-h) #1947 @jpy-git
- Remove plaintext API key from benchmark utility #1863 @jpy-git
- Add
skip_installto static analysis sections of tox.ini #1851 @jpy-git - Move typing_extensions from
requirements_dev.txttorequirements.txt#1956 @jpy-git
🐛 Bug Fixes
- Fix bug where "sqlfluff fix" deletes dbt "{% snapshot %}" line #1907 @barrywhart
- Fix subquery bug in L026 #1948 @jpy-git
- Fix bug where L041 was confused by L016's placement of newlines in the parse tree #1904 @barrywhart
- Fix progressbar artifacts within linter errors #1873 @adam-tokarski
- Correct Snowflake warehouse sizes #1872 @jpy-git
- Fixed Delimited() logic, added T-SQL grammar #1894 @WittierDinosaur
- L036 refinement - FROM clause interaction #1893 @jpy-git
- Add missing chardet install in setup.py #1928 @jpy-git
- Fix misplaced TableAliasInfo in L031 documentation #1946 @jpy-git
- Fix broken link to external SQL style guide #1918 @kevinmarsh
[0.8.1] - 2021-11-07
What’s Changed
Fixes missing dependency issue with 0.8.0 for tqdm, plus add a test to ensure this does not happen again.
🐛 Bug Fixes
- Fix: add tqdm to setup.py installation requirements #1842 @skykasko
- Add test to ensure pip install works #1843 @tunetheweb
[0.8.0] - 2021-11-07
What’s Changed
This release brings an improvement to the performance of the parser, a rebuild of the Jinja Templater, and a progress bar for the CLI. Lots of dialect improvements have also been done. Full list of changes below:
🚀 Enhancements
- Updated L009 logic to only allow a single trailing newline. #1838 @jpy-git
- Progressbar utility #1609 @adam-tokarski
- Teradata dialect: Add support for SEL form of SELECT #1776 @samlader
- Added trigger support in ANSI - and extended it in Postgres #1818 @WittierDinosaur
- Exasol: Make references more strict #1829 @sti0
- Hive: INSERT statement support #1828 @mifercre
- ANSI: Add TABLESAMPLE support #1811 @CrossNox
- T-SQL: Support trailing commas in CREATE TABLE #1817 @tommydb
- Spark3: Add CREATE VIEW support #1813 @DipeshCS
- BigQuery: Support PIVOT and UNPIVOT #1794 @tunetheweb
- L029: Optionally check quoted identifiers in addition to naked identifiers #1775 @jpers36
- Add sysdate to Redshift as a bare function #1789 @tdstark
- Robust Jinja raw/template mapping #1678 @barrywhart
- Add CREATE TABLE AS to Postgres and Redshift #1785 @tdstark
- Improve Parser Performance By Caching Values #1744 @WittierDinosaur
- templater-dbt: Change dbt dependency to dbt-core #1786 @amardeep
- T-SQL: Create Schema definition #1773 @jpers36
- T-SQL: allow optional brackets for column default constraints #1760 @nevado
- Postgres: Support parameters and identifiers prepended with _ and containing $ #1765 @WittierDinosaur
- Postgres: Added support for double precision #1764 @WittierDinosaur
- "sqlfluff fix": Write to a temporary .sql file first #1763 @barrywhart
- Update older dbt dependency #1756 @alanmcruickshank
- T-SQL: add IDENTITY column constraint #1757 @nevado
- Update CI to run under Python 3.10 #1739 @rooterkyberian
- MySQL: Add drop index support #1738 @fatelei
- Snowflake dialect improvements #1737 @tunetheweb
- Add missing test case #1735 @tunetheweb
🐛 Bug Fixes
- Fix: Add missing init file to sqlfluff.core.templaters.slicers #1826 @CrossNox
- Hive: Fix order of CREATE TEMPORARY EXTERNAL TABLE #1825 @mifercre
- T-SQL: add AS keyword as optional in PIVOT-UNPIVOT #1807 @tkachenkomaria244
- Prevent L019 plus L034 corrupting SQL #1803 @barrywhart
- L028 fix - Allow SELECT column alias in WHERE clauses for certain dialects #1796 @tunetheweb
- Comment out instructions in GitHub templates #1792 @tunetheweb
- Fix internal error in L016 when template/whitespace-only line too long #1795 @barrywhart
- Fix L049 to allow = NULL in SET clauses #1791 @tunetheweb
- Hive: Fix bug in CREATE TABLE WITH syntax #1790 @iajoiner
- Fixed encoding error when linting to file #1787 @WittierDinosaur
- Fix L012 documentation #1782 @jpers36
- T-SQL: fix quote alias #1766 @jpers36
- Fix incorrect indentation issue #1733 @tunetheweb
- T-SQL: Fix OVER functionality for functions #1731 @jpers36
[0.7.1] - 2021-10-22
What’s Changed
Highlights of this release contains a lot of T-SQL dialect improvements (shout out to @jpers36 for most of these!). We also added Spark3 as a new dialect thanks to @R7L208. The complete list of changes are shown below.
🚀 Enhancements
- T-SQL: Add rank functions #1725 @jpers36
- Spark3 Dialect Support #1706 @R7L208
- Postgres Array Support #1722 @WittierDinosaur
- Hive: Add LEFT SEMI JOIN support #1718 @fatelei
- MySQL: Change and drop column in alter table #1670 @MontealegreLuis
- Added type hints to some rule files #1616 @ttomasz
- Added Redshift to README #1720 @WittierDinosaur
- Exasol: Fix create table statement #1700 @sti0
- T-SQL: Add optional delimiter to SET #1717 @jpers36
- T-SQL: Escaped quotes #1715 @jpers36
- T-SQL: SELECT INTO #1714 @jpers36
- Postgres: Added support for psql variables #1709 @WittierDinosaur
- T-SQL: split location clause out from index clause #1711 @jpers36
- T-SQL: Override ANSI HAVING #1707 @jpers36
- T-SQL: Add UPDATE STATISTICS #1703 @jpers36
- T-SQL: CTAS Option Clause #1705 @jpers36
- T-SQL: DECLARE has optional AS #1704 @jpers36
- T-SQL: DROP STATISTICS and INDEX #1698 @jpers36
- T-SQL: CTAS select can be optionally bracketed #1697 @jpers36
- Exasol: Make function_script_terminator more strict #1696 @sti0
- T-SQL distribution index location #1695 @jpers36
- T-SQL: allow for non-alphanumeric initial characters in delimited identifiers #1693 @jpers36
- T-SQL: allow for semi-colon after BEGIN in a BEGIN/END block #1694 @jpers36
- Exasol: Fix adapter script syntax #1692 @sti0
- T-SQL: Basic EXECUTE functionality #1691 @jpers36
- T-SQL: Add #, @ to valid identifier characters #1690 @jpers36
- T-SQL - add support for Filegroups in table create #1689 @nevado
- Exclude Exasol scripts from rule L003 #1684 @tunetheweb
- Added PostGIS keyword data types to Postgres #1686 @WittierDinosaur
- Indent LIMIT values if on separate line #1683 @tunetheweb
- Postgres: Added support for SELECT INTO statements #1676 @WittierDinosaur
- Allow :: casting of CASE statements #1657 @tunetheweb
- Add more keywords to Redhift and BigQuery to avoid errors #1671 @tunetheweb
- T-SQL begin end delimiter #1664 @jpers36
- Teradata: Added date as bare function for #1663 @anzelpwj
- T-SQL: CREATE STATISTICS #1662 @jpers36
- T-SQL table and query hints #1661 @jpers36
- T-SQL: Allow spaces in qualified names #1654 @jpers36
🐛 Bug Fixes
- EXASOL: Fix typo in alter_table_statement #1726 @sti0
- Fix markdown links in production.rst #1721 @asottile
- Correct contributing testing information #1702 @adam-tokarski
- More ORDER BY clarifications #1681 @tunetheweb
- Fix T-SQL L025 linter exception #1677 @tunetheweb
- Improve Jinja whitespace handling in rules #1647 @barrywhart
[0.7.0] - 2021-10-14
BREAKING CHANGE
This release extracts the dbt templater to a separately installable plugin
sqlfluff-templater-dbt.
For users who take advantage of the dbt templater see the
updated docs on how to migrate.
It also adds the redshift dialect and removes the exasol_fs dialect which has been merged
into the exasol dialect.
What’s Changed
- src/sqlfluff/core/linter: Improve ignore file processing #1650 @CyberShadow
- Misc documentation updates #1644 @tunetheweb
- Segregate dbt plugin tests #1610 @alanmcruickshank
- Add initial Redshift support #1641 @tunetheweb
- Update docs for dbt templater, improve error messages when not installed. #1583 @alanmcruickshank
- Make templaters pluggable and move the dbt templater into a plugin #1264 @alanmcruickshank
🚀 Enhancements
- T-SQL: CTAS delimiter #1652 @jpers36
- T-SQL: Allow for multiple variables DECLAREd in the same statement #1651 @jpers36
- T-SQL: Allow DECLARE/SET statements to parse using ExpressionStatement #1649 @jpers36
- T-SQL PRINT statement parsing #1648 @jpers36
- Better date function for tsql #1636 @tunetheweb
- T-SQL: Allow for multiple statements in a procedure #1637 @jpers36
- T-SQL: Allow for !>, !< operators #1640 @jpers36
- T-SQL: Fix GROUP BY delimiter #1635 @jpers36
- T-SQL: Fix DROP delimiter #1633 @jpers36
- T-SQL: +RENAME statement for Azure Synapse Analytics #1631 @jpers36
- T-SQL: Fix CASTing variables #1627 @jpers36
- Snowflake: Add implementation for CREATE TASK statement #1597 #1603 @JoeHut
- Allow global config for rule testcases #1580 @sti0
- Snowflake dollar sign literals #1591 @myschkyna
- Rename test/fixtures/parser directory to test/fixtures/dialects #1585 @tunetheweb
- Rename keyword files #1584 @tunetheweb
- Add some more unreserved keywords to BigQuery #1588 @tunetheweb
- Increase minimum runs before coverage report is issued #1596 @tunetheweb
- Snowflake: Support CURRENT_TIMESTAMP as a column default value #1578 @wong-codaio
- T-SQL temp tables #1574 @jpers36
🐛 Bug Fixes
- Fix NoneType exception in L031 #1643 @tunetheweb
- Stop rule L048 complaining if literal is followed by a semicolon #1638 @tunetheweb
- L031 desc updated to cover both 'from' and 'join' #1625 @nevado
- Snowflake auto increments fixes #1620 @myschkyna
- Fix DECLARE Delimitation #1615 @jpers36
- Snowflake drop column fixes #1618 @myschkyna
- T-SQL: fix statement delimitation #1612 @jpers36
- Snowflake: Fixed data type casting not working in
SETstatement #1604 @wong-codaio - Postgres dialect: Fix parse error for "on delete", "on update" clauses in column constraints #1586 @samlader
- Fix AttributeError: 'NoneType' object has no attribute 'get_child' error with rule L031 #1595 @barrywhart
- Fix zero length templated file bug. #1577 @alanmcruickshank
- Fully remove exasol_fs dialect and bump version #1573 @alanmcruickshank
[0.6.9] - 2021-10-08
Another dbt bugfix from 0.6.7 and 0.6.8, plus a host of dialect and syntax improvements.
🚀 Enhancements
- Correct and expand Snowflake CREATE TABLE syntax [#1567] @tunetheweb
- Support brackets in Postgres Meta commands #1548 @tunetheweb
- added type hints to rule files #1515 @ttomasz
- Update Rule L028 to handle T-SQL PIVOT columns #1545 @tunetheweb
- T-SQL IF/ELSE #1564 @jpers36
- Enums for format types and colors added #1558 @adam-tokarski
- Add dbt 0.21.0 to the test suite #1566 @alanmcruickshank
- Merge EXASOL_FS dialect into EXASOL dialect #1498 @sti0
- T-SQL - BEGIN/END blocks #1553 @jpers36
- Small refactor with type hints and string formatting #1525 @adam-tokarski
- Add Github Preview Image #1557 @alanmcruickshank
- Support SETOF in Postgres #1522 @tunetheweb
- Support Double Precision in ANSI #1524 @tunetheweb
- Support LATERAL joins in Postgres #1519 @adam-tokarski
- Add a rule to warn on "= NULL" or "<> NULL" comparisons #1527 @barrywhart
- Support Group and Groups as table names #1546 @tunetheweb
- Support more complex IN (...) expressions #1550 @tunetheweb
- Support CROSS APPLY and OUTER APPLY and TOP in T-SQL #1551 @tunetheweb
- Add support for WITHOUT ROWID to SQLite #1531 @tunetheweb
- Postgres: add
CONCURRENTLYandFINALIZEkeywords toDETACH PARTITION#1529 @kevinmarsh - Better support of MySQL CREATE TABLE TIMESTAMP/DATESTAMP #1530 @tunetheweb
- "Found unparsable section" instead of stack trace when multiple semicolons provided #1517 @adam-tokarski
🐛 Bug Fixes
- Fix test coverage #1569 @tunetheweb
- Remove lint_templated_tokens as no longer does anything #1570 @tunetheweb
- Fix broken block comments in exasol #1565 @sti0
- Rethink sequence_files in dbt templater. #1563 @alanmcruickshank
- T-SQL: fix STRING_AGG() WITHIN GROUP clause #1559 @jpers36
- fix spelling: occurrence>occurrence #1507 @jpers36
[0.6.8] - 2021-10-05
Fixed a DBT bug introduced in 0.6.7 - apologies!
What’s Changed
SQLFluff can't find dbt models #1513 @barrywhart T-SQL: Support for unicode literals #1511 @adam-tokarski
[0.6.7] - 2021-10-04
Lots of fixes to our rules (particularly when running sqlfluff fix, and particularly for Jinja and DBT templates). We also have good improvements to Exasol, Snowflake, and T-SQL dialects amongst others. Plus we added Hive and SQLite as supported dialects!
What’s Changed
- Snowflake better WAREHOUSE and CREATE (EXTERNAL) TABLES support #1508 @tunetheweb
- Exasol: Fix typo in
REORGANIZEstatement #1509 @sti0 - Fix bug that can prevent linting ephemeral dbt models #1496 @barrywhart
- Disable rules L026 and L028 for BigQuery by default, with option to re-enable #1504 @tunetheweb
- BigQuery keywords #1506 @tunetheweb
- Inline --noqa not always honoured by "sqlfluff fix" #1502 @barrywhart
- Snowflake - fix parsing of UNPIVOT #1505 @michael-the1
- Better parsing of DATEADD function #1486 @jpers36
- Fix handling of ISNULL and NOTNULL keywords #1483 @leamingrad
- Improved test cases names #1501 @ttomasz
- Exasol: Fix CREATE TABLE in-/outline constraint / Adjusted DISTRIBUTE/PARTITION clause #1491 @sti0
- Add support for SnowSQL variables #1497 @samlader
- Ignore erroneous newline segments in L016 (e.g. Jinja for loops) #1494 @tunetheweb
- Indentation error on Jinja templated test case #1444 @barrywhart
- Improve EXASOL dialect #1484 @sti0
- T-SQL dialect - +support for CONVERT() special function #1489 @jpers36
- Allow Postgres column references to use
AT TIME ZONE#1485 @leamingrad - T-SQL dialect - provide alternate ASA PR incorporating ASA into T-SQL #1478 @jpers36
- Modest parser performance improvement #1475 @NathanHowell
- Disable rule L033 for dialects that do not support it (e.g. Exasol, Postgres) #1482 @tunetheweb
- Adding a new BaseFileSegment class for FileSegments to inherit from #1473 @sti0
- EXASOL_FS: Fix adapter script type #1480 @sti0
- Dialect/tsql update - added pivot / unpivot, view support, sequence support on table creation #1469 @ericmuijs
- Correct typo in SQLFluff name #1470 @tunetheweb
- Stop L008 from adding spaces for simple SELECTs #1461 @CyberShadow
- Add SQLite dialect #1453 @tunetheweb
- Fix Windows Clause for Exasol #1463 @tunetheweb
- Add CHECK constraint syntax to ANSI SQL #1451 @tunetheweb
- Move Exasol test statements fixtures from Python to SQL files #1449 @tunetheweb
- fix spelling of "preceding" #1455 @jpers36
- Add NORMALIZE to Teradata dialect #1448 @tunetheweb
- Add @ and $ symbols to Exasol to avoid lexing errors #1447 @tunetheweb
- Stop fix adding then removing whitespace #1443 @barrywhart
- Stop exception in L016 for long Jinja comments #1440 @tunetheweb
- Fix some issues where the SQL file is corrupted by lint "fixes" in or near Jinja loops #1431 @barrywhart
- T-SQL: Remove Limit and NamedWindow segments as not supported in T-SQL #1420 @jpers36
- Fix runtime error (IndexError ) when linting file with jinja "if" #1430 @barrywhart
- Add Hive dialect (#985) @satish-ravi
- Further fix for L036 #1428 @tunetheweb
- Add default parameter to dbt "var" macro stub #1426 @CyberShadow
[0.6.6] - 2021-09-20
Fixed some of our autofix rules where running fix sometimes made unintended changes. Added config to rules L011 and L012 to allow preferring implicit aliasing. Also further improved our Postgres support and documentation.
What’s Changed
- Rule L036 bug fixes #1427 @tunetheweb
- Added support for psql meta commands to Postgres #1423 @WittierDinosaur
- Remaining line endings #1415 @tunetheweb
- T-SQL: Remove match possibilities for segments with no T-SQL equivalent #1416 @jpers36
- Fix generate error on test file with just a comment #1413 @tunetheweb
- Misc fixes to workflow files #1412 @tunetheweb
- Added support for escape character strings to Postgres #1409 @WittierDinosaur
- Issue 845: L016 should compute line length prior to template expansion #1411 @barrywhart
- Add .editorconfig config and enforce style rules #1410 @tunetheweb
- Allow optional enforcing of implicit aliasing of tables (L011) and columns (L012) #1402 @tunetheweb
- Better error messages on error #1407 @tunetheweb
- Add README on how to generate docs #1403 @tunetheweb
- Fix extra underscores in case rules (L010 and L014) #1396 @tunetheweb
- Remove unused deps in tox test docbuild #1406 @zhongjiajie
- Prevent CodeCov commenting on coverage differences too early #1404 @tunetheweb
- Fix "sqlfluff fix compatible" rules indenting to much in documentation #1405 @tunetheweb
- Fix documentation SQL highlight error #1393 @zhongjiajie
- Support TIMESTAMPTZ in TIME ZONE queries for Postgres #1398 @tunetheweb
- Improve datatypes: CHARACTER VARYING for ANSI, and Postgres and also TIMESTAMP AT TIME ZONE for Postgres #1378 @WittierDinosaur
- Improve rules L003 and L019 by processing multi-line fixes in one pass. #1391 @barrywhart
- Correct codecov badge for Docs website #1390 @tunetheweb
- Change fix to use non-zero exit code if unfixable #1389 @tunetheweb
- Bugfix, frame clauses in window functions were not working #1381 @WittierDinosaur
- Handle template and unfixable errors when fixing stdin #1385 @nolanbconaway
- CREATE, ALTER, DROP SEQUENCE support, with Postgres extensions #1380 @WittierDinosaur
- Postgres analyze #1377 @WittierDinosaur
- L016: "sqlfluff fix" adds too many newlines #1382 @barrywhart
- L003 fix mixes hanging and clean indents #1383 @barrywhart
- L034 should not fix inside "INSERT" or "CREATE TABLE AS SELECT" #1384 @barrywhart
[0.6.5] - 2021-09-10
What’s Changed
This release includes initial support of Transact-SQL (T-SQL), much better Postgres and Snowflake support, improvements to our documentation, 100% coverage for Python code (with a small number of accepted exceptions), along with numerous other bug fixes and improvements.
Many thanks to all the contributors helping to improve SQLFluff!
Complete list of changes
- Simplify rule L030 and fix recursion bug (#1376) (@tunetheweb
- Move from CircleCI to GitHub Actions for Continuous Integration (#1361) (@tunetheweb
- Postgres enhance create index (#1375) (@WittierDinosaur
- Initial support for Transact-SQL (T-SQL) dialect (#1313) (@ericmuijs
- Handle initial whitespace lines in rule L001 (#1372) (@tunetheweb
- Postgres Improved DEFAULT column constraint support (#1373) (@WittierDinosaur
- Minor grammar, spelling, and readability fixes (#1370) (@WittierDinosaur
- Issues 854, 1321: Handle Jinja leading whitespace-only lines (#1364) (@barrywhart
- Enhanced the Postgres grammar for create table (#1369) (@WittierDinosaur
- Added ability to Grant and Revoke Grant to multiple users (#1367) (@WittierDinosaur
- Add BigQuery Parameter Lexing and Parsing (#1363) (@rileyrunnoe
- Rule L030 bugfix (#1360) (@WittierDinosaur
- Add Postgres dialect for COMMENT ON (#1358) (@miketheman
- Allow ORDER BY and LIMIT after QUALIFY in BigQuery (#1362) (@tunetheweb
- Correct CircleCI badge reference (#1359) @miketheman
- Minor grammar corrections to documentation (#1355) @miketheman
- Pytest coverage exceptions to get us to 100% coverage! (#1346) @tunetheweb
- Greatly improved Snowflake syntax support (#1353) @tunetheweb
- Postgres keyword support (#1347) @WittierDinosaur
- Added full support for postgres's ALTER DEFAULT PRIVILEGES. (#1350) @creste
- Show all LintResult in Rule_L020 (#1348) @zhongjiajie
- Enhance error message L010 base on configure (#1351) @zhongjiajie
- Remove unused variable insert_str (#1352) @zhongjiajie
- Pytest coverage exceptions for Core code - part 1 (#1343) @tunetheweb
- BigQuery: Allow Qualify Clause for UnorderedSelectStatements (#1341) @tunetheweb
- Postgres "ALTER TABLE" enhancement, and timestamp bug fix (#1338) @WittierDinosaur
- Improve pytest coverage for non-core code (#1319) @tunetheweb
- Support additional GRANTs in Postgres (#1339) @creste
- Allow optional alias for BigQuery WITH OFFSET (#1330) @tunetheweb
- Improve function support in Postgres dialect (#1336) @WittierDinosaur
- Using github star instead of watch in docs (#1337) @zhongjiajie
- Add unittest for rules docstring (#1335) @zhongjiajie
- Bugfix PR, fixes issue #1333, wherein test___main___help() defaults to your default Python installation (#1334) @WittierDinosaur
- Improve wording of L007 now the before/after is configurable (#1325) @tunetheweb
- Fix a couple of small issues with CI jobs (#1326) @tunetheweb
- Add updated sqlfluff graphics and source. (#1315) @alanmcruickshank
- Issue 1277: Enforce that YML test files are computer generated and not edited (#1279) @barrywhart
- Fix typo in README (#1320) @tunetheweb
- Fix link in README (#1316) @jmks
- Update documentation to make the project more discoverable (#1311) @tunetheweb
- Show latest version number on unsupported Python error message (#1307) @zhongjiajie
- Fix typo in github PR template (#1308) @zhongjiajie
[0.6.4] - 2021-08-20
Added
- Added support for empty WINDOWS specifications (#1293) @matthieucan
- Added auto release drafter (#1287) @tunetheweb
Changed
- Fix typo in the in the wild page (#1285) @tunetheweb
- Fix spacing issue for BigQuery UNNEST statement for rules L003 and L025 (#1303) @tunetheweb
- Update GitHub templates (#1297) @tunetheweb
- Allow BigQuery UDF with triple quoted bodies to pass rule L048 (#1300) @tunetheweb
- Add Parameterless Functions and more function names support to BigQuery (#1299) @tunetheweb
- Add release drafter (#1295) @tunetheweb
- Support empty OVER() clause in Window Specification (#1294) @tunetheweb
- Fix typo on the In the Wild page (#1285) @tunetheweb
[0.6.3] - 2021-08-16
Added
- Support for primary index name, collect stats improvement, COMMENT statement for teradata dialect #1232
- Support config for L007 to prefer end of line operators #1261
- Support for DETERMINISTIC user defined functions in BigQuery dialect #1251
- Support more identifiers in BigQuery dialect #1253
- Support function member field references in BigQuery dialect #1255
- Support alternative indentation for USING and ON clauses #1250
- Support COUNT(0) preference over COUNT(*) or COUNT(1) #1260
- Support for BigQuery "CREATE table OPTIONS ( description = 'desc' )" #1205
- Support wildcard member field references in BigQuery dialect #1269
- Support ARRAYS of STRUCTs in BigQuery dialect #1271
- Support fields of field references in BigQuery dialect #1276
- Support OFFSET and ORDINAL clauses of Array Functions in BigQuery dialect #1171
- Added check for generated YML files #1277
- Support QUALIFY to BigQuery dialect #1242
Changed
- Fix comma removed by L019 #939
- Update L019 (leading/trailng comma rule) so it doesn't run on unparsable code.
- The
--nocolorcommand-line option should suppress emoji output #1246 - Added HTTP Archive to the In The Wild page
[0.6.2] - 2021-07-22
Added
- Support for looping statements (loop, while, repeat) and supporting statements to mysql dialect #1180
Changed
- Added dbt 0.20.* to the default test suite.
- Updated manifest loading in dbt 0.20.* to use the new
ManifestLoader#1220 - Handle newlines in rule list configuration in .sqlfluff #1215
- Fix looping interaction between L008 and L030 #1207
[0.6.1] - 2021-07-16
Added
- Linting output now supports GitHub Actions #1190
- Support for QUALIFY syntax specific to teradata dialect #1184
- Support for TRUNCATE statement #1194
- Support for prepared statement syntaxes specific to mysql dialect #1147
- Support for GET DIAGNOSTICS statement syntax specific to mysql dialect #1148
- Support for cursor syntax specific to mysql dialect #1145
- Support sequential shorthand casts #1178
- Support for select statement syntax specific to mysql dialect #1175
- Support for the CALL statement for the mysql dialect #1144
- Support for OVERLAPS predicate #1091
- Support for the CREATE/DROP PROCEDURE statement for the mysql dialect #901
- Specific allowed/required syntaxes for CREATE/DROP FUNCTION within the mysql dialect #901
- Support for DECLARE statement for the mysql dialect #1140
- Support for the IF-THEN-ELSEIF-ELSE syntax for the mysql dialect #1140
- Support for the DEFINER syntax for the mysql dialect #1131
- Preserve existing file encoding in the "fix" command. Partially addresses #654
- Support for DECLARE and SET variable syntax for the BigQuery dialect #1127
- Support for ALTER TASK statement on Snowflake #1211
Changed
- Fix runtime error in diff-cover plugin caused by new diff-cover release 6.1.0 #1195
- Resolved an issue with the snowflake dialect where backslash escaped single quoted strings led to fatal lexing errors #1200
Contributors
- [@GitHub-Username](Link to GitHub profile) ([#PR-Number](Link to PR))
- @dflss (#1154)
- @barrywhart (#1177, #1195)
- @niallrees (#1178)
- @barnabyshearer (#1194)
- @silverbullettruck2001 (#1141, #1159, #1161, #1176, #1179, #1181, #1193, #1203)
[0.6.0] - 2021-06-06
Added
- Respect XDG base dirs on Mac OS (#889).
- Added support for additional delimiters by creating a new DelimiterSegment in the ANSI dialect which defaults to the semicolon, but allows it to be more intuitive when overridden in a specific child dialect (mysql) #901)
- Added support for the DELIMITER statement in the mysql dialect #901)
- Added support for additional delimiters by creating a new DelimiterSegment in the ANSI dialect which defaults to the semicolon, but allows it to be more intuitive when overridden in a specific child dialect (mysql) #901)
- Added support for function as a default column value #849.
- Add an
--include-metasoption for parse output to show the meta segments in the parse tree. - Allow CREATE FUNCTION syntax without arguments @bolajiwahab #1063.
- Added support for the CREATE/DROP PROCEDURE statement for the mysql dialect #901)
- Added specific allowed/required syntaxes for CREATE/DROP FUNCTION within the mysql dialect #901)
- Now possible to run sqlfluff commands outside the project root when using the dbt templater.
Changed
- Renamed --parallel CLI argument to --processes to be more accurate.
- L034 now ignores select statements which contain macros.
- L034 now ignores select statements part of a set expression, most commonly a union.
- Fix bug #1082, adding
support for BigQuery
select as struct '1' as bb, 2 as aasyntax. - Rationalisation of the placement of meta segments within templated queries to support more reliable indentation. This includes prioritising longer invariant sections first and then dropping any shorter ones which then are relatively out of place.
- Additional logging within the lexer and templater engines.
- Allow meta segments to parse within
Delimitedgrammars which otherwise don't allow gaps. This is facilitated through an optional argument totrim_non_code_segments. - Fix bug #1079, addressing
issues with L025 and L026 with BigQuery column references involving
STRUCT. - #1080 Add SET SCHEMA and DROP SCHEMA support to ANSI dialect.
Contributors
[0.6.0a2] - 2021-05-27
Changed
- Better exception handling for the simple parsing API (
sqlfluff.parse) which now raises an exception which holds all potential parsing issues and prints nicely with more than one issue. - Fix bug #1037, in which fix logging had been sent to stdout when reading data from stdin.
- Add a little bit of fun on CLI exit 🎉!
- Disabled models in the dbt templater are now skipped entirely rather than returning an untemplated file.
- Add a changelog check to SQLFluff continuous integration.
- Fix bug #1083, adding support for BigQuery named function arguments, used with functions such as ST_GEOGFROMGEOJSON()
- Update documentation links to sqlfluff-online.
[0.6.0a1] - 2021-05-15
Added
- Lint and fix parallelism using
--parallelCLI argument - Fix 1051, adding support
for bitwise operators
&,|,^,<<,>>
[0.5.6] - 2021-05-14
- Bugfix release for an issue in
L016introduced in0.5.4. - Fix for
L016issue whereDISTINCTkeywords were mangled during fixing #1024.
[0.5.5] - 2021-05-13
- Bugfix release for an off-by-one error introduced in L016 as part of
0.5.4.
[0.5.4] - 2021-05-12
Added
- Parsing of Postgres dollar quoted literals.
- Parsing of Postgres filter grammar.
- Parsing of "ALTER DEFAULT PRIVILEGES" Postgres statement.
- Parsing of Postgres non-explicit role granting and function execution.
- Early failing on fatal dbt templater fails.
Changed
- Big rewrite of the lexer, segments and position markers for simplicity and to support future parallelism work.
- Fix to L036 which previously mangled whitespace.
[0.5.3] - 2021-05-04
Added
L009can now be enforced whentemplater = dbt.- Parsing of
EXPLAIN,USEstatements. - Parsing of
ALTER TABLE x RENAME TO ysyntax. - Parsing of
ALTER SESSIONin snowflake. - Parsing of numeric literals with exponents.
- Added rule codes to diff_cover output.
Changed
- Fix
templater = dbtL009 bug #861 where:sqlfluff lintwould incorrectly always returnL009 | Files must end with a trailing newline.sqlfluff fixwould remove trailing newlines whenexclude_rules = L009.
- Fix bug with BigQuery comparison operators.
- Fix recursion bug with L045.
- Fix tuple index bug with L016.
- Fix mange coalecse bug with L043.
- Fix Jinja templating error with UnboundLocalError.
- Improve array parsing.
- Simplify bracket parsing.
- Speed up L010 with caching capitalisation policy.
- Output of
sqlfluff dialectsis now sorted. - Handle disabled
dbtmodels.
[0.5.2] - 2021-04-11
Changed
- Fix false positive in L045 when CTE used in WHERE clause (#944)
- Logging and readout now includes more detail and a notification of dbt compilation.
- Fix bug in L048 which flagged adjoining commas as failures.
- Fix bug in L019 with inline comments.
- Fix bug in L036 with multiple newlines.
- Skip disabled dbt models. (#931).
- Support "USE" statement in ANSI (#902).
- Parse explain statement (#893).
[0.5.1] - 2021-04-09
Changed
- Parsing improvements around optional brackets.
- Better parsing of set operators (like
UNION) and how they interact withORDER BYclauses. - Support for comparison operators like
~. - Fix parsing of snowflake
SAMPLEsyntax. - Fix recursion issues in L044.
SPACEkeyword now has no special meaning in the postgres dialect.
[0.5.0] - 2021-04-05
Added
pascal(PascalCase)capitalisation_policyoption for L014 (unquoted identifiers)only_aliasesconfiguration option for L014 (unquoted identifiers)- Dialects now have more advanced dependency options to allow less repetition
between related dialects. The methods
get_segmentandget_grammarcan be used on unexpanded grammars to access elements of the parent grammars. Thecopymethod on grammars can be used to copy with alterations. - Rule L046 to line whitespace within jinja tags.
- Enable and Disable syntax for ignoring violations from ranges of lines.
Changed
- Renamed the BaseCrawler class to BaseRule. This is the base class for all rules. This is a breaking change for any custom rules that have been added via plugins or by forking the SQLFluff repo.
- Renamed
sqlfluff.rules()tosqlfluff.list_rules()andsqlfluff.dialects()tosqlfluff.list_dialects()due to naming conflicts with the now separatesqlfluff.dialectsmodule. - Extracted dialect definitions from the
sqlfluff.coremodule so that each dialect is better isolated from each other. This also allows more focused testing and the potential for dialect plugins in future. Dialects are now only imported as needed at runtime. All dialects should now be accessed using the selector methods insqlfluff.core.dialectsrather than importing fromsqlfluff.dialectsdirectly. - Add support for
ALTER USERcommands in Snowflake dialect. - Added describe statement to ANSI dialect
- Renamed
capitalisation_policytoextended_capitalisation_policyfor L014 to reflect the fact that it now accepts more options (pascal) than regularcapitalisation_policystill used by L010 and others. - Replaced
only_aliasesconfig withunquoted_identifiers_policyand added it to rule L014 in addition to L029. - Parse structure of
FROMclauses to better represent nested joins and table functions. - Parse structure of expressions to avoid unnecessary nesting and overly recursive method calls.
[0.4.1] - 2021-02-25
Added
- Initial architecture for rule plugins to allow custom rules. This initial release should be considered beta until the release of 0.5.0.
- Add tests for dbt 0.19.0.
- General increased parsing coverage.
- Added some missing Postgres syntax elements.
- Added some basic introspection API elements to output what dialects and rules are available for use within the API.
Changed
- Fix several Snowflake parsing bugs.
- Refactor from clause to handle flattens after joins.
- Fix .get_table_references() in Snowflake dialect.
- Macros defined within the .sqlfluff config will take precedence over the macros defined in the
path that is defined with config value
sqlfluff:templater:jinja:load_macros_from_path. - Fix Snowflake indent parsing.
- Fixed incorrect parsing of syntax-like elements in comments.
- Altered parsing of
NULLkeywords, so parse as Literals where appropriate. - Fixed bug in expression parsing leading to recursion errors.
[0.4.0] - 2021-02-14
Added
- Public API to enable people to import
sqlfluffas a python module and callparse,lintandfixwithin their own projects. See the docs for more information. (#501) - The ability to use
dbtas a templating engine directly allowing richer and more accurate linting arounddbtmacros (and packages related todbt). For more info see the docs. (#508) - Support for modulo (
%) operator. (#447) - A limit in the internal fix routines to catch any infinite loops. (#494)
- Added the
.is_type()method on segments to more intelligently deal with type matching in rules when inheritance is at play. - Added the ability for the user to add their own rules when interacting
with the
Linterdirectly usinguser_rules. - Added L034 'Fields should be stated before aggregates / window functions' per dbt coding convenventions (#495)
- Templating tags, such as
{{ variables }},{# comments #}and{% loops %}(in jinja) now have placeholders in the parsed structure. Rule L003 (indentation), also now respects these placeholders so that their indentation is linted accordingly. For loop or block tags, they also generate anIndentandDedenttag accordingly (which can be enabled or disabled) with a configuration value so that indentation around these functions can be linted accordingly. (#541) - MyPy type linting into a large proportion of the core library. (#526, #580)
- Config values specific to a file can now be defined using a comment
line starting with
-- sqlfluff:. (#541) - Added documentation for
--noqa:use in rules. (#552) - Added
pre-commithooks forlintandfix. (#576) - Added a fix routine for Rule L019 (comma placement). (#575)
- Added Rule L031 to enforce "avoid using alias in the
FROM/JOINclauses" from thedbtcoding conventions. (#473, #479) - Added Rule L032 to enforce "do not use
USING" from thedbtcoding conventions. (#487) - Added Rule L033 to enforce "prefer
UNION ALLtoUNION *" from thedbtcoding conventions. (#489) - Added Rule L034 to enforce "fields should be stated before aggregate/window functions" from the
dbtcoding conventions. (#495) - Added Rule L038 to forbid (or require) trailing commas in select clauses. (#362)
- Added Rule L039 to lint unnecessary whitespace between elements. (#502)
- Added a fix routine for L015. (#732)
- Added a fix routine for L025. (#404)
- Adopted the
blackcoding style. (#485) - Added validation and documentation for rule configuration options. (#462)
- Added documentation for which rules are fixable. (#594)
- Added
EPOCHkeyword for postgres dialect. (#522) - Added column index identifier in snowflake dialect. (#458)
- Added
USEstatement to the snowflake dialect. (#537) - Added
CODE_OF_CONDUCTto the project. (#471) - Added
ISNULLandNOTNULLkeywords to ansi dialect. (#441) - Added support for python 3.9. (#482)
- Added
requirements_dev.txtfor local testing/linting. (#500) - Added CLI option
--disregard-sqlfluffignoresto allow direct linting of files in the.sqlfluffignore. (#486) - Added
dbtincrementalmacro. (#363) - Added links to cockroachlabs expression grammars in ansi dialect. (#592)
- Added favicon to the docs website. (#589)
- Added
CREATE FUNCTIONsyntax for postgres and for bigquery. (#325) - Added
CREATE INDEXandDROP INDEXfor mysql. (#740) - Added
IGNORE NULLS,RESPECT NULLS,GENERATE_DATE_ARRAYandGENERATE_TIMESTAMP_ARRAYfor bigquery. ( #667, #527) - Added
CREATEandCREATE ... CLONEfor snowflake. (#539) - Added support for EXASOL. (#684)
Changed
- Fixed parsing of semi-structured objects in the snowflake of dialects with whitespace gaps. #634
- Handle internal errors elegantly, reporting the stacktrace and the error-surfacing file. #632
- Improve message for when an automatic fix is not available for L004. #633
- Linting errors raised on templated sections are now ignored by default and added a configuration value to show them. (#713)
- Big refactor of logging internally.
Linteris now decoupled from logging so that it can be imported directly by subprojects without needing to worry about weird output or without the log handing getting in the way of your project. (#460) - Linting errors in the final file are now reported with their position in the source file rather than in the templated file. This means when using sqlfluff as a plugabble library within an IDE, the references match the file which is being edited. (#541)
- Created new Github Organisation (https://github.com/sqlfluff) and migrated from https://github.com/alanmcruickshank/sqlfluff to https://github.com/sqlfluff/sqlfluff. (#444)
- Changed the handling of
*anda.b.*expressions to have their own expressions. Any dependencies on this structure downstream will be broken. This also fixes the linting of both kinds of expressions with regard to L013 and L025. (#454) - Refactor of L022 to handle poorly formatted CTEs better. (#494)
- Restriction of L017 to only fix when it would delete whitespace or newlines. (#598)
- Added a configuration value to L016 to optionally ignore lines containing only comments. (#299)
- Internally added an
EphemeralSegmentto aid with parsing efficiency without altering the end structure of the query. (#491) - Split
ObjectReferenceintoColumnReferenceandTableReferencefor more useful API access to the underlying structure. (#504) KeywordSegmentand the newSymbolSegmentboth now inherit from_ProtoKeywordSegmentwhich allows symbols to match in a very similar way to keywords without later appearing with thetypeofkeyword. (#504)- Introduced the
Parserclass to parse a lexed query rather than relying on users to instantiate aFileSegmentdirectly. As a result theFileSegmenthas been moved from the core parser directly into the dialects. Users can refer to it via theget_root_segment()method of a dialect. (#510) - Several performance improvements through removing unused functionality, sensible caching and optimising loops within functions. (#526)
- Split up rule tests into separate
ymlfiles. (#553) - Allow escaped quotes in strings. (#557)
- Fixed
ESCAPEparsing inLIKEclause. (#566) - Fixed parsing of complex
BETWEENstatements. (#498) - Fixed BigQuery
EXCEPTclause parsing. (#472) - Fixed Rule L022 to respect leading comma configuration. (#455)
- Improved instructions on adding a virtual environment in the
README. (#457) - Improved documentation for passing CLI defaults in
.sqlfluff. (#452) - Fix bug with templated blocks +
capitalisation_policy = lower. (#477) - Fix array accessors in snowflake dialect. (#442)
- Color
loggingwarnings red. (#497) - Allow whitespace before a shorthand cast. (#544)
- Silenced warnings when fixing from stdin. (#522)
- Allow an underscore as the first char in a semi structured element key. (#596)
- Fix PostFunctionGrammar in the Snowflake dialect which was causing strange behaviour in L012. (#619)
Bracketedsegment now obtains its brackets directly from the dialect using a set namedbracket_pairs. This now enables better configuration of brackets between dialects. (#325)
Removed
- Dropped support for python 3.5. (#482)
- From the CLI, the
--no-safetyoption has been removed, the default is now that all enabled rules will be fixed. (#583) - Removed
BaseSegment.grammar,BaseSegment._match_grammar()andBaseSegment._parse_grammar()instead preferring references directly toBaseSegment.match_grammarandBaseSegment.parse_grammar. (#509) - Removed
EmptySegmentGrammarand replaced with better non-code handling in theFileSegmentitself. (#509) - Remove the
ContainsOnlygrammar as it remained only as an anti-pattern. (#509) - Removed the
expected_string()functionality from grammars and segments (#509) as it was poorly supported. - Removed
BaseSegment.as_optional()as now this functionality happens mostly in grammars (includingRef). (#509) - Removed
ColumnExpressionSegmentin favour ofColumnReference. (#512) - Removed the
LambdaSegmentfeature, instead replacing with an internal to the grammar module calledNonCodeMatcher. (#512) - Case sensitivity as a feature for segment matching has been removed as not required for existing dialects. (#517)
- Dependency on
diffliborcdifflib, by relying on source mapping instead to apply fixes. (#541)
[0.3.6] - 2020-09-24
Added
sqlfluff dialectscommand to get a readout of available dialects [+ associated docs].- More helpful error messages when trying to run in Python2.
- Window functions now parse with
IGNORE/RESPECTNULLS. - Parsing of
current_timestampand similar functions. Thanks @dmateusp. - Snowflake
QUALIFYclause.
Changed
- Respect user config directories. Thanks @sethwoodworth.
- Fix incorrect reporting of L013 with
*. Thanks @dmateusp. - Fix incorrect reporting of L027 with column aliases. Thanks @pwildenhain.
- Simplification of application of fixes and correction of a case where fixes could be depleted. Thanks @NiallRees.
- Fix functions with a similar structure to
SUBSTRING. - Refactor BigQuery
REPLACEandEXCEPTclauses. - Bigquery date parts corrected.
- Snowflake array accessors.
- Psotgres
NOTNULLandISNULL. - Bugfix in snowflake for keywords used in semistructured queries.
- Nested
WITHstatements now parse. - Performance improvements in the
fixcommand. - Numeric literals starting with a decimal now parse.
- Refactor the jinja templater.
[0.3.5] - 2020-08-03
Added
- Patterns and Anti-patterns in documentation. Thanks @flpezet.
- Functions in
GROUP BY. Thanks @flpezet.
Changed
- Deep bugfixes in the parser to handle simple matching better for a few edge cases. Also added some logging deeper in the parser.
- Added in the
SelectableGrammarand some related segments to make it easier to refer to select-like things in other grammars. - Fixes to
CASEstatement parsing. Thanks @azhard. - Fix to snowflake
SAMPLEimplementation. Thanks @rkm3. - Numerous docs fixes. Thanks @SimonStJG, @flpezet, @s-pace, @nolanbconaway.
[0.3.4] - 2020-05-13
Changed
- Implementation of the bigquery
CREATE MODELsyntax. Thanks @barrywhart. - Bugfixes for:
- Edge cases for L006
- False alarms on L025
ORDER BY x NULLS FIRST|LASTFORkeyword in bigquerySYSTEM_TIMEsyntax.
[0.3.3] - 2020-05-11
Added
- Added the
--nofailoption toparseandlintcommands to assist rollout. - Added the
--versionoption to complement theversionoption already available on the cli. - Parsing for
ALTER TABLE. - Warning for unset dialects when getting parsing errors.
- Configurable line lengths for output.
[0.3.2] - 2020-05-08
Added
- Support for the Teradata dialect. Thanks @Katzmann1983!
- A much more detailed getting started guide in the docs.
- For the
parsecommand, added the--profilerand--benchoptions to help debugging performance issues. - Support for the
docommand in the jinja templater. - Proper parsing of the concatenate operator (
||). - Proper indent handling of closing brackets.
- Logging and benchmarking of parse performance as part of the CI pipeline.
- Parsing of object references with defaults like
my_db..my_table. - Support for the
INTERVAL '4 days'style interval expression. - Configurable trailing or leading comma linting.
- Configurable indentation for
JOINclauses. - Rules now have their own logging interface to improve debugging ability.
- Snowflake and Postgres dialects.
- Support for a
.sqlfluffignorefile to ignore certain paths. - More generic interfaces for managing keywords in dialects, including
setinterfaces for managing and creating keywords and theRef.keyword()method to refer to them, and the ability to refer directly to keyword names in most grammars using strings directly. IncludesSegmentGeneratorobjects to bind dialect objects at runtime from sets. Thanks @Katzmann1983! - Rule
L029for using unreserved keywords as variable names. - The jinja templater now allows macros loaded from files, and the
hydration of variables ending in
_pathin the config files. - JSON operators and the
DISTINCT ON ()syntax for the postgres dialect.
Changed
- Refactor of whitespace and non-code handling so that segments are less greedy and default to not holding whitespace on ends. This allows more consistent linting rule application.
- Change config file reading to case-sensitive to support case sensitivity in jinja templating.
- Non-string values (including lists) now function in the python and jinja templating libraries.
- Validation of the match results of grammars has been reduced. In production cases the validation will still be done, but only on parse and not on match.
- At low verbosities, python level logging is also reduced.
- Some matcher rules in the parser can now be classified as simple which allows them to shortcut some of the matching routines.
- Yaml output now double quotes values with newlines or tab characters.
- Better handling on hanging and closing indents when linting rule L003.
- More capable handline of multi-line comments so that indentation and line length parsing works. This involves some deep changes to the lexer.
- Getting violations from the linter now automatically takes into account of ignore rules and filters.
- Several bugfixes, including catching potential infinite regress during fixing of files, if one fix would re-introduce a problem with another.
- Behaviour of the
Bracketedgrammar has been changed to treat its content as aSequencerather than aOneOf. - Move to
SandboxedEnvironmentrather thanEnvironmentfor jinja templating for security. - Improve reporting of templating issues, especially for the jinja templater so that missing variables are rendered as blanks, but still reported as templating violations.
[0.3.1] - 2020-02-17
Added
- Support for
a.b.*on top ofa.*in select target expressions.
[0.3.0] - 2020-02-15
Changed
- Deprecated python 2.7 and python 3.4 which are now both past their maintenance horizon. The 0.2.x branch will remain available for continued development for these versions.
- Rule L003 is now significantly smarter in linting indentation with support for hanging indents and comparison to the most recent line which doesn't have an error. The old (more simple) functionality of directly checking whether an indent was a multiple of a preset value has been removed.
- Fixed the "inconsistent" bug in L010. Thanks @nolanbconaway.
- Updated logging of parsing and lexing errors to have more useful error codes.
- Changed parsing of expressions to favour functions over identifiers to fix the expression bug.
- Fixed the "inconsistent" bug in L010. Thanks @nolanbconaway.
- Moved where the
SELECTkeyword is parsed within a select statement, so that it belongs as part of the newly renamedselect_clause(renamed from previouslyselect_target_group). - Clarified handling of the
typeandnameproperties of the BaseSegment class and its children.nameshould be specific to a particular kind of segment, andtypeshould express a wider group. Handling of thenewline,whitespaceandcommasegments has been updated so that we use thetypeproperty for most use cases rather thanname.
Added
- Meta segments for indicating where things can be present in the parsed
tree. This is mostly illustrated using the
IndentandDedentsegments used for indicating the position of theoretical indents in the structure. Several helper functions have been added across the codebase to handle this increase in the kinds of segments which might be encountered by various grammars. - Rule L016 has been added to lint long lines. In the
fixphase of this rule, there is enough logic to try and reconstruct a sensible place for line breaks as re-flow the query. This will likely need further work and may still encounter places where it doesn't fix all errors but should be able to deal with the majority of simple cases. - BigQuery dialect, initially just for appropriate quoting.
- Added parsing of DDL statements such as
COMMIT,DROP,GRANT,REVOKEandROLLBACK. Thanks @barrywhart. --formatoption to theparsecommand that allows a yaml output. This is mostly to make test writing easier in the development process but might also be useful for other things.- Parsing of set operations like
UNION. - Support for the
diff-covertool. Thanks @barrywhart. - Enabled the
fixcommand while usingstdin. Thanks @nolanbconaway. - Rule to detect incorrect use of
DISTINCT. Thanks @barrywhart. - Security fixes from DeepCover. Thanks @sanketsaurav.
- Automatic fix testing, to help support the newer more complicated rules.
- Interval literals
- Support for the
sourcemacro from dbt. Thanks @Dandandan - Support for functions with spaces between the function name and the brackets
and a linting rule
L017to catch this. - Efficiency cache for faster pruning of the parse tree.
- Parsing of array notation as using in BigQuery and Postgres.
- Enable the
ignoreparameter on linting and fixing commands to ignore particular kinds of violations.
[0.2.4] - 2019-12-06
Added
- A
--code-onlyoption to theparsecommand to spit out a more simplified output with only the code elements. - Rules can now optionally override the description of the violation
and pass that back via the
LintingResult.
Changed
- Bugfix, correct missing files in
setup.pyinstall_requiressection. - Better parsing of the not equal operator.
- Added more exclusions to identifier reserved words to fix cross joins.
- At verbosity levels 2 or above, the root config is printed and then any diffs to that for specific files are also printed.
- Linting and parsing of directories now reports files in alphabetical order. Thanks @barrywhart.
- Better python 2.7 stability. Thanks @barrywhart.
- Fixing parsing of
IN/NOT INandIS/IS NOT.
[0.2.3] - 2019-12-02
Changed
- Bugfix, default config not included.
[0.2.2] - 2019-12-02
Changed
- Tweak rule L005 to report more sensibly with newlines.
- Rework testing of rules to be more modular.
- Fix a config file bug if no root config file was present for some values. Thanks @barrywhart.
- Lexing rules are now part of the dialect rather than a global so that they can be overridden by other dialects when we get to that stage.
[0.2.0] - 2019-12-01
Added
- Templating support (jinja2, python or raw).
- Variables + Macros.
- The
fixcommand is also sensitive to fixing over templates and will skip certain fixes if it feels that it's conflicted.
- Config file support, including specifying context for the templater.
- Documentation via Sphinx and readthedocs.
- Including a guide on the role of SQL in the real world. Assisted by @barrywhart.
- Documentation LINTING (given we're a linting project) introduced in CI.
- Reimplemented L006 & L007 which lint whitespace around operators.
- Ability to configure rule behaviour directly from the config file.
- Implemented L010 to lint capitalisation of keywords.
- Allow casting in the parser using the
::operator. - Implemented
GROUP BYandLIMIT. - Added
ORDER BYusing indexes and expressions. - Added parsing of
CASEstatements. - Support for window/aggregate functions.
- Added linting and parsing of alias expressions.
Changed
- Fixed a bug which could cause potential infinite recursion in configuration
- Changed how negative literals are handled, so that they're now a compound segment rather than being identified at the lexing stage. This is to allow the parser to resolve the potential ambiguity.
- Restructure of rule definitions to be more streamlined and also enable
autodocumentation. This includes a more complete
RuleSetclass which now holds the filtering code. - Corrected logging in fix mode not to duplicate the reporting of errors.
- Now allows insert statements with a nested
withclause. - Fixed verbose logging during parsing.
- Allow the
Bracketedgrammar to optionally match empty brackets using the optional keyword.
[0.1.5] - 2019-11-11
Added
- Python 3.8 Support!
Changed
- Moved some of the responsibility for formatted logging into the linter to mean that we can log progressively in large directories.
- Fixed a bug in the grammar where one of the return values was messed up.
[0.1.4] - 2019-11-10
Added
- Added a
--exclude-rulesargument to most of the commands to allow rule users to exclude specific subset of rules, by @sumitkumar1209 - Added lexing for
!=,~and::. - Added a new common segment:
LambdaSegmentwhich allows matching based on arbitrary functions which can be applied to segments. - Recursive Expressions for both arithmetic and functions, based heavily off the grammar provided by the guys at CockroachDB.
- An
Anythinggrammar, useful in matching rather than in parsing to match anything.
Changed
- Complete rewrite of the bracket counting functions, using some centralised class methods
on the
BaseGrammarclass to support common matching features across multiple grammars. In particular this affects theDelimitedgrammar which is now much simpler but does also require slightly more liberal use of terminators to match effectively. - Rather than passing around multiple variables during parsing and matching, there is now
a
ParseContextobject which contains things like the dialect and various depths. This simplifies the parsing and matching code significantly. - Bracket referencing is now done from the dialect directly, rather than in individual
Grammars (except the
Bracketedgrammar, which still implements it directly). This takes out some originally duplicated code. - Corrected the parsing of ordering keywords in and
ORDER BYclause.
Removed
- Removed the
bracket_sensitive_forward_matchmethod from theBaseGrammar. It was ugly and not flexible enough. It's been replaced by a suite of methods as described above.
[0.1.3] - 2019-10-30
Changed
- Tweak to the L001 rule so that it doesn't crash the whole thing.
[0.1.2] - 2019-10-30
Changed
- Fixed the errors raised by the lexer.
[0.1.1] - 2019-10-30
Changed
- Fixed which modules from sqlfluff are installed in the setup.py. This affects
the
versioncommand.
[0.1.0] - 2019-10-29
Changed
- Big Rewrite - some loss in functionality might be apparent compared to pre-0.1.0. Please submit any major problems as issues on github
- Changed unicode handling for better escape codes in python 2. Thanks @mrshu
- BIG rewrite of the parser, completely new architecture. This introduces
breaking changes and some loss of functionality while we catch up.
- In particular, matches now return partial matches to speed up parsing.
- The
Delimitedmatcher has had a significant re-write with a major speedup and broken the dependency onSequence. - Rewrite of
StartsWithandSequenceto use partial matches properly. - Different treatment of numeric literals.
- Both
BracketedandDelimitedrespect bracket counting. - MASSIVE rewrite of
Bracketed.
- Grammars now have timers.
- Joins properly parsing,
- Rewrite of logging to selectively output commands at different levels
of verbosity. This uses the
verbosity_loggermethod. - Added a command line
sqlfluff parseoption which runs just the parsing step of the process to better understand how a file is being parsed. This also has options to configure how deep we recurse. - Complete Re-write of the rules section, implementing new
crawlerswhich implement the linting rules. Now with inbuilt fixers in them. - Old rules removed and re implemented so we now have parity with the old rule sets.
- Moved to using Ref mostly within the core grammar so that we can have recursion.
- Used recursion to do a first implementation of arithmetic parsing. Including a test for it.
- Moved the main grammar into a separate dialect and renamed source and test files accordingly.
- Moved to file-based tests for the ansi dialect to make it easier to test using the tool directly.
- As part of file tests - expected outcomes are now encoded in yaml to make it easier to write new tests.
- Vastly improved readability and debugging potential of the _match logging.
- Added support for windows line endings in the lexer.
[0.0.7] - 2018-11-19
Added
- Added a
sqlfluff fixas a command to implement auto-fixing of linting errors. For now onlyL001is implemented as a rule that can fix things. - Added a
rulescommand to introspect the available rules. - Updated the cli table function to use the
testwraplibrary and also deal a lot better with longer values. - Added a
--rulesargument to most of the commands to allow rule users to focus their search on a specific subset of rules.
Changed
- Refactor the cli tests to use the click CliRunner. Much faster
[0.0.6] - 2018-11-15
Added
- Number matching
Changed
- Fixed operator parsing and linting (including allowing the exception of
(*))
[0.0.5] - 2018-11-15
Added
- Much better documentation including the DOCS.md
Changed
- Fixed comma parsing and linting
[0.0.4] - 2018-11-14
Added
- Added operator regexes
- Added a priority for matchers to resolve some ambiguity
- Added tests for operator regexes
- Added ability to initialise the memory in rules
[0.0.3] - 2018-11-14
Added
- Refactor of rules to allow rules with memory
- Adding comma linting rules (correcting the single character matchers)
- Adding mixed indentation linting rules
- Integration with CircleCI, CodeCov and lots of badges
Changed
- Changed import of version information to fix bug with importing config.ini
- Added basic violations/file reporting for some verbosities
- Refactor of rules to simplify definition
- Refactor of color cli output to make it more reusable
[0.0.2] - 2018-11-09
Added
- Longer project description
- Proper exit codes
- colorama for colored output
Changed
- Significant CLI changes
- Much improved output from CLI
[0.0.1] - 2018-11-07
Added
- Initial Commit! - VERY ALPHA
- Restructure into package layout
- Adding Tox and Pytest so that they work