Skip to content

Releases: sql-formatter-org/sql-formatter

15.2.0

30 Jan 09:15
Compare
Choose a tag to compare

Larger change in PostgreSQL keywordCase handling

  • Removed almost all of PostgreSQL non-reserved keywords #709

The keywords list that's used for uppercasing keywords is now much smaller.
This will lead to some keywords not being uppercased any more.
But it will eliminate several cases where table and column names were detected as keywords and uppercased.

15.1.3

26 Jan 09:32
Compare
Choose a tag to compare

Bugfixes

  • Allow for keywords after : operator in Snowflake #706

15.1.2

22 Jan 15:06
Compare
Choose a tag to compare

Bugfixes

  • Fix tabular formatting for CREATE TABLE #690

15.1.1

22 Jan 11:06
Compare
Choose a tag to compare

Bugfixes

  • Format Transact-SQL OPTION () clause on a separate line #705
  • Format Transact-SQL FOR clause on a separate line

15.1.0

21 Jan 17:57
Compare
Choose a tag to compare

New features

  • Add support for disable/enable comments to turn off formatting for sections of SQL file #703
  • Allow passing inline JSON config object from command line (e.g. --config '{"keywordCase": "upper"}') #701

Bugfixes

  • Treat ASC,DESC as reserved words in "sql" dialect #702
  • Fix crash when database..table syntax encountered in Transact-SQL #700

15.0.2

10 Dec 08:00
Compare
Choose a tag to compare

Bugfix

  • Export KeywordCase and DataTypeCase types

15.0.1

10 Dec 07:36
Compare
Choose a tag to compare

Bugfix

  • Improve IDENTIFIED BY formatting in MySQL, MariaDB & SingleStoreDB (#691) Thanks to eeXun

15.0.0

07 Dec 18:35
Compare
Choose a tag to compare

Breaking changes

  • The keywordCase option no more applies to data types.
  • The identifierCase option no more applies to function names.
  • New formatting style of CREATE TABLE (#495) Thanks to Timon Jurschitsch
  • New formatting style of CREATE VIEW
  • When using custom dialects: TokenizerOptions has new mandatory reservedDataType field.

New features

  • Added functionCase option (#237) Thanks to Karl Horky
  • Added dataTypeCase option (#653) Thanks to Karl Horky

Bugfixes

  • Support *.* syntax in MySQL GRANT statements (#674)
  • No more treat some common table/field names in PostgreSQL as keywords (#156)
  • Allow type to be used as identifier in PostgreSQL (#685)

14.0.0

21 Nov 08:31
Compare
Choose a tag to compare

Breaking changes

These already deprecated features were fundamentally broken and have been removed for good:

  • Removed tabulateAlias config option.
  • Removed commaPosition config option.

Potentially breaking:

  • The DB2 support has been completely overhauled. Previously it was a mix of features from DB2 for IBM z mainframe and DB2 for LUW (Linux, Unix, Windows). Now the dialect named "db2" specifically targets the LUW variant.
  • Snowflake dialect now includes all data types in the keywords list. Which means that when keywordCase: upper option is used, the data type names are also converted to uppercase. (#641)
  • The SqlLanguage type is no more just a plain string (a regression), but a union of the builtin SQL dialect names.
  • The DialectOptions type now includes a mandatory name field. (Relevant only when implementing a custom dialect.)

New features

  • New experimental identifierCase config option. This works similarly to the existing keywordCase option. (Thanks to Christian Jorgensen.)

Bugfixes

  • Various tweaks and fixes for the new DB2i dialect (introduced in 13.1.0).
  • Fixed formatting of TIMESTAMP() WITH TIME ZONE in PostgreSQL (#618)
  • Improved error messages from the parser to help users self-diagnose the most common issues.

13.1.0

10 Nov 09:56
Compare
Choose a tag to compare

New dialect

  • DB2 for IBM i (thanks to Christian Jorgensen) #658

Minor improvements

  • Support parameters inside schema.table.col syntax to facilitate its use as a workaround for SQL templating