github sql-formatter-org/sql-formatter v12.0.0-beta.1
12.0.0-beta.1

latest releases: v15.6.9, v15.6.8, v15.6.7...
pre-release2 years ago

Major formatting style change

Most of the simple statements are now formatted more so on one line (#483).

For example the following SQL, previously formatted as follows:

ALTER TABLE
  foo
ALTER COLUMN
  col1
SET DEFAULT
  10;

DROP TABLE
  my_tbl;

DELETE FROM
  customers
WHERE
  age > 99;

UPDATE
  orders
SET
  price = 0,
  total = 0
WHERE
  deleted = TRUE;

will now be formatted on a single line:

ALTER TABLE foo
ALTER COLUMN col1
SET DEFAULT 10;

DROP TABLE my_tbl;

DELETE FROM customers
WHERE
  age > 99;

UPDATE orders
SET
  price = 0,
  total = 0
WHERE
  deleted = TRUE;

Breaking change in extension API

Instead of extending the Formatter class, there's now a DialectOptions object (#493).
This object can now be supplied to language parameter to implement a custom SQL dialect.

Bugfixes

  • Support nested CASE expressions (#494)
  • The MySQL USE keyword formatting should no more cause syntax error (#456)

Don't miss a new sql-formatter release

NewReleases is sending notifications on new releases.