unstale

npm / sql-formatter

sql-formatter

What changed in sql-formatter 4 to 15, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-20.

55 breaking39 new APIs and options4 performance28 behavior and defaults40 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

sql-formatter 1533 changes

Breaking changes 5

  • Removes multi-word function names from MySQL.

    15.7.1release notes

  • identifierCase no longer applies to function names.

    15.0.0release notes

  • keywordCase no longer applies to data types.

    15.0.0release notes

  • Some common table and field names in PostgreSQL are no longer treated as keywords.

    15.0.0release notes

  • Custom dialects must now provide the reservedDataType field in TokenizerOptions.

    15.0.0release notes

New APIs and options 8

  • The modulo operator is now supported in SingleStoreDB.

    15.9.0release notes

  • The parser now supports the pg_dump commands \restrict and \unrestrict.

    15.9.0release notes

  • Adds the missing OPENJSON Transact-SQL function.

    15.7.3release notes

  • sql-formatter supports the CORRESPONDING keyword on Trino set operations.

    15.7.2release notes

  • Clickhouse SQL dialect is now supported.

    15.7.0release notes

  • Adds support for PostgreSQL 18 UUID functions.

    15.6.12release notes

  • Added the dataTypeCase option.

    15.0.0release notes

  • Added the functionCase option.

    15.0.0release notes

Performance 1

  • Parsing long SQL expression lists avoids quadratic accumulation.

    15.9.0release notes

Behavior and default changes 10

  • Trino numeric literals can now contain underscores.

    15.9.1release notes

  • Formatting now keeps spaces around PostgreSQL OPERATOR() when denseOperators is enabled.

    15.9.0release notes

  • Formatting keeps the colon dense inside [] for DuckDB array slices.

    15.9.0release notes

  • A reserved word after AS is now treated as an alias.

    15.9.0release notes

  • BigQuery formatting now always keeps spaces around the - operator.

    15.8.2release notes

  • PostgreSQL formatting now supports keywords in CREATE CONSTRAINT TRIGGER.

    15.8.0release notes

  • SQLite formatting now supports Tcl-style $param(...) syntax.

    15.7.4release notes

  • CREATE TABLE statements use a new formatting style.

    15.0.0release notes

  • CREATE VIEW statements use a new formatting style.

    15.0.0release notes

  • PostgreSQL now allows type to be used as an identifier.

    15.0.0release notes

Fixes and other changes 9

  • Added support for several operators in Transact-SQL, Spark, DuckDB and Redhsift.

    15.9.1release notes

  • Formatting removes the extra space after BETWEEN _ AND _ expressions.

    15.9.0release notes

  • Formatting now keeps a space when densing - before a negative operand.

    15.9.0release notes

  • Fixed an idempotency issue with block-comment placement.

    15.8.1release notes

  • Fixes formatting of the >^ geometric operator.

    15.7.3release notes

  • Adds missing PostgreSQL operators.

    15.7.3release notes

  • Properly formats TIMESTAMP WITH TIME ZONE in Trino.

    15.7.3release notes

  • Formats COMMENT ON as keywords in PostgreSQL.

    15.6.11release notes

  • MySQL GRANT statements now support the *.* syntax.

    15.0.0release notes

sql-formatter 1410 changes

Breaking changes 5

  • The deprecated commaPosition config option has been removed.

    14.0.0release notes

  • The db2 dialect now specifically targets DB2 for LUW, rather than mixing features from DB2 for IBM z and DB2 for LUW.

    14.0.0release notes

  • DialectOptions now requires a name field when implementing a custom dialect.

    14.0.0release notes

  • SqlLanguage is now a union of the builtin SQL dialect names instead of a plain string.

    14.0.0release notes

  • The deprecated tabulateAlias config option has been removed.

    14.0.0release notes

New APIs and options 1

  • A new experimental config option controls identifier casing similarly to keywordCase.

    14.0.0release notes

Behavior and default changes 2

  • Parser error messages were improved to help users self-diagnose the most common issues.

    14.0.0release notes

  • Snowflake data type names are now included in the keywords list and converted to uppercase when keywordCase: upper is used.

    14.0.0release notes

Fixes and other changes 2

  • Various tweaks and fixes were made for the DB2i dialect.

    14.0.0release notes

  • Formatting of TIMESTAMP() WITH TIME ZONE in PostgreSQL was fixed.

    14.0.0release notes

sql-formatter 135 changes

Breaking changes 2

  • COMMENT is no longer placed on a separate line in dialects like MariaDB; in dialects supporting COMMENT ON ..., it triggers a new line only when used together with ON.

    13.0.0release notes

  • With keywordCase: upper, words like user and name are no longer capitalized in MySQL, MariaDB, and SingleStoreDB because their keyword lists now contain only reserved words.

    13.0.0release notes

Fixes and other changes 3

  • Fixed a crash when formatting Transact-SQL containing goto labels.

    13.0.0release notes

  • Fixed formatting of the ON DUPLICATE KEY UPDATE clause in MariaDB-like dialects.

    13.0.0release notes

  • Fixed formatting of the VALUES function in MariaDB-like dialects.

    13.0.0release notes

sql-formatter 129 changes

Breaking changes 3

  • Custom dialects no longer need to extend the Formatter class; provide a DialectOptions object instead.

    12.0.0release notes

  • The language parameter no longer specifies a custom dialect; use formatDialect() instead.

    12.0.0release notes

  • Most simple SQL statements are now formatted more on one line, changing the output produced by the formatter.

    12.0.0release notes

New APIs and options 4

  • Custom dialect configuration now supports custom quote types.

    12.0.0release notes

  • New API for formatting with a specified dialect, enabling bundlers to eliminate unused dialect code and reduce bundle size.

    12.0.0release notes

  • Named function arguments using the => operator are now supported in Trino.

    12.0.0release notes

  • package.json was added to the package exports list.

    12.0.0release notes

Behavior and default changes 1

Fixes and other changes 1

  • Formatting the MySQL USE keyword no longer causes a syntax error.

    12.0.0release notes

sql-formatter 116 changes

Breaking changes 1

  • The library is now exported as an ES module, affecting how developers import it.

    11.0.0release notes

New APIs and options 1

Behavior and default changes 2

  • CASE expressions are formatted better.

    11.0.0release notes

  • The denseOperators config now also applies to the : operator.

    11.0.0release notes

Fixes and other changes 2

  • Inline block-comments are formatted better.

    11.0.0release notes

  • ON UPDATE/DELETE constraints are formatted better.

    11.0.0release notes

sql-formatter 104 changes

Breaking changes 3

  • The extraParens config replaces the openParens and closeParens configs.

    10.0.0release notes

  • Unbalanced parentheses, braces, or brackets now produce an error (#277).

    10.0.0release notes

  • Formatting SQL with braces or brackets in a dialect that does not support them now throws error #400.

    10.0.0release notes

Performance 1

  • Formatting is slower overall, which should only affect users formatting megabytes worth of SQL.

    10.0.0release notes

sql-formatter 924 changes

Breaking changes 5

New APIs and options 2

Behavior and default changes 5

  • The approach to matching function calls changed.

    9.0.0release notes

  • Supported joins and set operations were revised in multiple dialects.

    9.0.0release notes

  • Reserved keyword lists were revised in multiple dialects.

    9.0.0release notes

  • Additional variations in SELECT query clauses are supported, including WITH RECURSIVE.

    9.0.0release notes

  • Supported string types were revised in multiple dialects.

    9.0.0release notes

Fixes and other changes 12

  • Formatting in tabular style was fixed.

    9.0.0release notes

  • Support for various BigQuery DDL statements was improved.

    9.0.0release notes

  • Support for double-quoted strings in Spark was fixed.

    9.0.0release notes

  • Multiword commands now format correctly with keywordCase set to upper.

    9.0.0release notes

  • MySQL and MariaDB identifiers may now begin with a number.

    9.0.0release notes

  • Parameter substitution now works in BETWEEN expressions.

    9.0.0release notes

  • Redshift identifiers may now begin with #.

    9.0.0release notes

  • Formatting of SELECT DISTINCT was improved.

    9.0.0release notes

  • The semicolon-on-separate-line bug was fixed.

    9.0.0release notes

  • Formatting of PL/SQL tbl@dblink syntax was improved.

    9.0.0release notes

  • Formatting of Trino row patterns was improved.

    9.0.0release notes

  • The missing type-definition file when importing sql-formatter in TypeScript was fixed.

    9.0.0release notes

sql-formatter 83 changes

Breaking changes 3

  • The multilineLists config option was removed.

    8.0.0release notes

  • The newlineBeforeCloseParen config option was removed.

    8.0.0release notes

  • The newlineBeforeOpenParen config option was removed.

    8.0.0release notes

sql-formatter 733 changes

Breaking changes 13

  • Backtick-quoted identifiers are no longer supported in PL/SQL, DB2, PostgreSQL, Redshift, or Transact-SQL.

    7.0.0release notes

  • BigQuery identifiers no longer allow $ or @ characters.

    7.0.0release notes

  • BigQuery identifiers now handle dashes correctly; double dashes begin a comment.

    7.0.0release notes

  • DB2 no longer supports bracket-quoted identifiers.

    7.0.0release notes

  • SQLite no longer supports this parameter placeholder syntax.

    7.0.0release notes

  • DB2 identifiers no longer allow # or @ characters.

    7.0.0release notes

  • Spark no longer supports double-quoted identifiers.

    7.0.0release notes

  • Incorrect reserved keywords were removed from SQLite, affecting which words keywordCase changes.

    7.0.0release notes

  • PostgreSQL no longer supports this parameter placeholder syntax.

    7.0.0release notes

  • Periods are no longer allowed inside parameter placeholder names.

    7.0.0release notes

  • The params option is no longer supported for Hive and Spark; use ${name} variables instead.

    7.0.0release notes

  • PL/SQL parameter placeholder names no longer allow # or $ characters, or periods.

    7.0.0release notes

  • The unminified bundle was removed from dist; only the minified bundle and source map remain.

    7.0.0release notes

New APIs and options 11

  • PL/SQL now supports numbered :1 and :2 parameter placeholders.

    7.0.0release notes

  • N1QL now supports numbered $1 and $2 parameter placeholders.

    7.0.0release notes

  • Array literals are now supported in BigQuery.

    7.0.0release notes

  • PostgreSQL bit strings are now supported.

    7.0.0release notes

  • Hex strings are now supported in standard SQL, SQLite, Spark, PostgreSQL, MariaDB, and MySQL.

    7.0.0release notes

  • Oracle now supports &name substitution variables.

    7.0.0release notes

  • Hive and Spark now support ${name} variables.

    7.0.0release notes

  • BigQuery now supports @name named and quoted parameter placeholders.

    7.0.0release notes

  • DB2 now supports the N, G, GX, UX, and U& prefixed string types.

    7.0.0release notes

  • BigQuery now supports R, B, and RB prefixed strings.

    7.0.0release notes

  • BigQuery now supports triple-double-quoted and triple-single-quoted strings.

    7.0.0release notes

Performance 2

  • Formatting long SQL strings is much faster, addressing a long-standing performance problem.

    7.0.0release notes

  • Repeated calls are much faster because tokenizer construction is cached.

    7.0.0release notes

Behavior and default changes 4

  • DB2 parameters now support @, #, and $ characters.

    7.0.0release notes

  • PostgreSQL, MariaDB, MySQL, and Transact-SQL identifiers now support the $ character.

    7.0.0release notes

  • Oracle SQL function names are now recognized and affected by the keywordCase option.

    7.0.0release notes

  • SQLite function names are now recognized and affected by the keywordCase option.

    7.0.0release notes

Fixes and other changes 3

  • MySQL function names are now properly uppercased when keywordCase is set to upper.

    7.0.0release notes

  • Fixed incorrectly inserted spaces inside map keys.

    7.0.0release notes

  • Fixed incorrect string token regular expressions.

    7.0.0release notes

sql-formatter 623 changes

Breaking changes 6

  • Added an option to specify a JSON config file, replacing the removed formatting CLI options.

    6.0.0release notes

  • Removed in favor of configuring indentation in a JSON config file.

    6.0.0release notes

  • The library indent option was replaced by configuration options for indentation.

    6.0.0release notes

  • Removed in favor of configuring lines between queries in a JSON config file.

    6.0.0release notes

  • Removed in favor of configuring keyword casing in a JSON config file.

    6.0.0release notes

  • The library uppercase option was replaced by a configuration option for keyword casing.

    6.0.0release notes

New APIs and options 6

  • Added support for the Apache Hive SQL dialect.

    6.0.0release notes

  • Added support for the GCP BigQuery SQL dialect.

    6.0.0release notes

  • Added a config option to set keyword casing.

    6.0.0release notes

  • Added a config option to set the number of lines between queries.

    6.0.0release notes

  • Added a config option to set indentation width.

    6.0.0release notes

  • Added a config option to use tabs for indentation.

    6.0.0release notes

Behavior and default changes 4

Fixes and other changes 7

  • Fixed formatting of CHARACTER SET.

    6.0.0release notes

  • Fixed command-line regressions.

    6.0.0release notes

  • Backtick-quoted identifiers and single-quoted strings are supported again with the default language: "sql".

    6.0.0release notes

  • Fixed various issues with operator handling.

    6.0.0release notes

  • The keyword is now properly recognized in Postgres, MariaDB, N1QL, and PL/SQL.

    6.0.0release notes

  • Fixed a Safari crash caused by regex look-behind.

    6.0.0release notes

  • Improved handling of standard output.

    6.0.0release notes

sql-formatter 416 changes

Breaking changes 9

  • The default export was removed; import the format function as a named export.

    4.0.0release notes

  • The CLI no longer accepts the -f / --file option; provide a file as a positional argument instead.

    4.0.0release notes

  • The format function is now available only as a named export.

    4.0.0release notes

  • The FORMATTERS export was removed.

    4.0.0release notes

  • The pl/sql alias was removed; use plsql instead.

    4.0.0release notes

  • Use plsql as the replacement for the removed pl/sql alias.

    4.0.0release notes

  • A file can now be supplied as a positional CLI argument instead of using the removed file option.

    4.0.0release notes

  • The standard SQL formatter now supports only standard SQL quotes, parameter placeholders, operators, and comments; use a dialect-specific language for other syntax.

    4.0.0release notes

  • Output line endings are always converted to UNIX LF, avoiding mixed UNIX and Windows line endings.

    4.0.0release notes

New APIs and options 6

  • MariaDB support is available as a formatter dialect.

    4.0.0release notes

  • MySQL support is available as a formatter dialect.

    4.0.0release notes

  • PostgreSQL support is available as a formatter dialect.

    4.0.0release notes

  • Additional operators are supported.

    4.0.0release notes

  • supportedDialects is available as a named export and is used by the CLI.

    4.0.0release notes

  • Transact-SQL support is available as a formatter dialect.

    4.0.0release notes

Fixes and other changes 1

  • Formatting of BETWEEN _ AND _ expressions is now proper.

    4.0.0release notes