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](https://docs.sqlfluff.com/en/latest/releasenotes.html).
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 `FluffConfig` object directly, and better support for parsing
config files directly from strings (see
[the included example](examples/05_simple_api_config.py)).
- A bugfix for `AM06`.
- A new `--warn-unused-ignores` CLI option (and corresponding config
setting) to allow warnings to be shown if any `noqa` comments 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](https://github.com/kaiyannameighu),
[josef-v](https://github.com/josef-v),
[aglebov](https://github.com/aglebov) &
[joaostorrer](https://github.com/joaostorrer) who made their first
contributions as part of this release! 🎉🎉🎉
What’s Changed
* Mypy: Ephemeral + Tuple Return on .parse() [5044](https://github.com/sqlfluff/sqlfluff/pull/5044) [alanmcruickshank](https://github.com/alanmcruickshank)
* Add support to oracle's global and private temporary tables [5039](https://github.com/sqlfluff/sqlfluff/pull/5039) [joaostorrer](https://github.com/joaostorrer)
* Redshift-dialect: Support GRANT USAGE ON DATASHARE [5007](https://github.com/sqlfluff/sqlfluff/pull/5007) [josef-v](https://github.com/josef-v)
* :white_check_mark: Add strict typing for errors module [5047](https://github.com/sqlfluff/sqlfluff/pull/5047) [pwildenhain](https://github.com/pwildenhain)
* Less copying in the ParseContext [5046](https://github.com/sqlfluff/sqlfluff/pull/5046) [alanmcruickshank](https://github.com/alanmcruickshank)
* Adding support to use `ADD COLUMN IF NOT EXISTS` syntax on `ALTER TABLE` [5035](https://github.com/sqlfluff/sqlfluff/pull/5035) [wfelipew](https://github.com/wfelipew)
* Closes 4815 [5042](https://github.com/sqlfluff/sqlfluff/pull/5042) [joaostorrer](https://github.com/joaostorrer)
* Fix for multiprocessing warnings. [5032](https://github.com/sqlfluff/sqlfluff/pull/5032) [alanmcruickshank](https://github.com/alanmcruickshank)
* Mypy gain: Remove unnecessary tuple construction in MatchResult [5045](https://github.com/sqlfluff/sqlfluff/pull/5045) [alanmcruickshank](https://github.com/alanmcruickshank)
* mypy strict in config [5036](https://github.com/sqlfluff/sqlfluff/pull/5036) [pwildenhain](https://github.com/pwildenhain)
* strict mypy: match_wrapper & match_logging [5033](https://github.com/sqlfluff/sqlfluff/pull/5033) [alanmcruickshank](https://github.com/alanmcruickshank)
* MyPy on errors, helpers, markers & context + remove ParseContext.denylist [5030](https://github.com/sqlfluff/sqlfluff/pull/5030) [alanmcruickshank](https://github.com/alanmcruickshank)
* Warn on unused `noqa` directives [5029](https://github.com/sqlfluff/sqlfluff/pull/5029) [alanmcruickshank](https://github.com/alanmcruickshank)
* Even more mypy strict [5023](https://github.com/sqlfluff/sqlfluff/pull/5023) [WittierDinosaur](https://github.com/WittierDinosaur)
* Handle windows paths better in config files. [5022](https://github.com/sqlfluff/sqlfluff/pull/5022) [alanmcruickshank](https://github.com/alanmcruickshank)
* Fix for parsing of Oracle functions with named arguments [5027](https://github.com/sqlfluff/sqlfluff/pull/5027) [joaostorrer](https://github.com/joaostorrer)
* DOC: Fix .sqlfluff example in Getting Started [5026](https://github.com/sqlfluff/sqlfluff/pull/5026) [aglebov](https://github.com/aglebov)
* Fix: Add exception to the warning & config for the BaseRule. [5025](https://github.com/sqlfluff/sqlfluff/pull/5025) [alanmcruickshank](https://github.com/alanmcruickshank)
* Move from `make_template` to `render_func` in jinja and dbt [4942](https://github.com/sqlfluff/sqlfluff/pull/4942) [alanmcruickshank](https://github.com/alanmcruickshank)
* Streamline imports to reduce initial load times 4917 [5020](https://github.com/sqlfluff/sqlfluff/pull/5020) [alanmcruickshank](https://github.com/alanmcruickshank)
* More mypy strict [5019](https://github.com/sqlfluff/sqlfluff/pull/5019) [WittierDinosaur](https://github.com/WittierDinosaur)
* Simple API config and examples [5018](https://github.com/sqlfluff/sqlfluff/pull/5018) [alanmcruickshank](https://github.com/alanmcruickshank)
* Fix some new linting issues [5021](https://github.com/sqlfluff/sqlfluff/pull/5021) [alanmcruickshank](https://github.com/alanmcruickshank)
* A step towards mypy strict [5014](https://github.com/sqlfluff/sqlfluff/pull/5014) [WittierDinosaur](https://github.com/WittierDinosaur)
* Materialize: Make RETURNING a reserved keyword [5017](https://github.com/sqlfluff/sqlfluff/pull/5017) [bobbyiliev](https://github.com/bobbyiliev)
* Config from string and load default_config as resource [5012](https://github.com/sqlfluff/sqlfluff/pull/5012) [alanmcruickshank](https://github.com/alanmcruickshank)
* Documentation for the test suite (2180) [5011](https://github.com/sqlfluff/sqlfluff/pull/5011) [alanmcruickshank](https://github.com/alanmcruickshank)
* Add support to oracle's listagg function [4999](https://github.com/sqlfluff/sqlfluff/pull/4999) [joaostorrer](https://github.com/joaostorrer)
* Assorted typehints [5013](https://github.com/sqlfluff/sqlfluff/pull/5013) [alanmcruickshank](https://github.com/alanmcruickshank)
* Refactor: Extract noqa methods and tests. [5010](https://github.com/sqlfluff/sqlfluff/pull/5010) [alanmcruickshank](https://github.com/alanmcruickshank)
* AM06 to ignore aggregate ORDER BY clauses [5008](https://github.com/sqlfluff/sqlfluff/pull/5008) [tunetheweb](https://github.com/tunetheweb)
* Bugfix: Treat Function name properly in grants [5006](https://github.com/sqlfluff/sqlfluff/pull/5006) [WittierDinosaur](https://github.com/WittierDinosaur)
* Redshift: Add Qualify Clause [5002](https://github.com/sqlfluff/sqlfluff/pull/5002) [WittierDinosaur](https://github.com/WittierDinosaur)
* Clickhouse Dialect - Support Dollar Quoted Literals [5003](https://github.com/sqlfluff/sqlfluff/pull/5003) [kaiyannameighu](https://github.com/kaiyannameighu)
New Contributors
* [kaiyannameighu](https://github.com/kaiyannameighu) made their first contribution in [#5003](https://github.com/sqlfluff/sqlfluff/pull/5003)
* [joaostorrer](https://github.com/joaostorrer) made their first contribution in [#4999](https://github.com/sqlfluff/sqlfluff/pull/4999)
* [aglebov](https://github.com/aglebov) made their first contribution in [#5026](https://github.com/sqlfluff/sqlfluff/pull/5026)
* [josef-v](https://github.com/josef-v) made their first contribution in [#5007](https://github.com/sqlfluff/sqlfluff/pull/5007)