Skip to content

Releases: sql-formatter-org/sql-formatter

9.0.0-beta2

16 Jul 09:00
Compare
Choose a tag to compare
9.0.0-beta2 Pre-release
Pre-release

Improvements

  • Improved support for various BigQuery DDL statements (thanks to Ahmad Khan #319)

Bugfixes

  • Fixed aliasAs option inserting AS keywords to BigQuery functions #309
  • Fixed parameter substitution not working in BETWEEN expressions #318

Internals

  • Placed each language.formatter.ts file to separate directory and separated functions and keywords to separate files #315
  • Removed RESERVED_JOIN_CONDITION token type.

9.0.0-beta1

14 Jul 09:47
Compare
Choose a tag to compare
9.0.0-beta1 Pre-release
Pre-release

New approach to function call matching

This release brings a major change to how function calls are detected:

  • Only known builtin function names are now formatted like TRIM()
  • Any other function calls (e.g. user-defined functions) get formatted as MY_FUNC ()

This fixes a long-standing problem where the format of input SQL effected output SQL. For example, if input contained TRIM (), then it was formatted as TRIM () and when it contained TRIM() then it was formatted as TRIM(). This in turn lead to problems where re-formatting an already formatted SQL could lead to different result. #140

8.2.0

13 Jul 18:02
Compare
Choose a tag to compare

New feature

  • Added support for formatting WINDOW clause in all dialects supporting it #305

8.1.0

12 Jul 09:55
Compare
Choose a tag to compare

Bugfixes

  • Fix formatting of DESC inside ORDER BY for MariaDB #298
  • Fix multiple problems with LIMIT clause formatting #301 #303

Improvements

  • No more adding spaces around :: operator.
  • Add support for multiple PostgreSQL JSON and other operators #296
  • Add support for N1QL operator: ||.
  • Add support for DB2 operators: ¬=, ¬>, ¬<.
  • Add support for SQLite operators: ->, ->>.
  • Add support for ~, #, ?, ! operators in several dialects.

Internals

  • Reorganize code in core/ dir into lexer/, parser/, formatter/ directories.
  • Major refactoring of Tokenizer.
  • Several new token types: DELIMITER, COMMA, IDENTIFIER, QUOTED_IDENTIFIER, NAMED_PARAMETER, QUOTED_PARAMETER, INDEXED_PARAMETER, POSITIONAL_PARAMETER.

8.0.2

05 Jul 08:44
Compare
Choose a tag to compare

Bugfixes

  • Fix BigQuery STRUCT formatting #279
  • Fix BigQuery FROM clause operators formatting #279

8.0.1

04 Jul 17:45
Compare
Choose a tag to compare

Bugfix

  • Support arrays in PostgreSQL #275

8.0.0

04 Jul 10:32
Compare
Choose a tag to compare

Breaking changes

  • Removed multilineLists config option
  • Removed newlineBeforeOpenParen config option
  • Removed newlineBeforeCloseParen config option

Internal changes

  • Moved all the syntax structure detection from formatter to parser.

7.0.4

03 Jul 11:35
Compare
Choose a tag to compare
  • Improve CREATE TABLE & CREATE VIEW formatting for BigQuery. #269
  • Upgrade dependencies. Notably switch from TypeScript 4.6.3 to 4.7.4. #271

7.0.3

01 Jul 06:47
Compare
Choose a tag to compare

Warnings and deprecations

A warning is now printed when params option values are not all strings. For now just a warning. In next major version non-string values will no more be accepted.

Deprecated the following config options:

  • multilineLists
  • newlineBeforeOpenParen
  • newlineBeforeCloseParen

These will get removed in next major version.

7.0.2

21 Jun 12:30
Compare
Choose a tag to compare

Bugfixes

  • Support array subscript operator in BigQuery #243

Internal changes

  • Move aliasAs processing out of formatting phase