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
- TSQL: 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
- TSQL: Create Schema definition #1773 @jpers36
- TSQL: 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
- TSQL: 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
- TSQL: 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
- TSQL: fix quote alias #1766 @jpers36
- Fix incorrect indentation issue #1733 @tunetheweb
- TSQL: Fix OVER functionality for functions #1731 @jpers36