From 4.x to 6.x
This release is mostly a back-merge of the Prettier SQL fork.
The latest stable release of SQL Formatter was 4.0.2. Prettier SQL continued from that, releasing Prettier SQL 5.0 ... 5.1.1. Now back in SQL Formatter we're skipping the 5.x versions and going straight to 6.
Breaking changes since 4.x
Command line options --indent
(-i
), --tab-indent
(-t
), --uppercase
(-u
) and --lines-between-queries
have been removed in favor of using a JSON config file which can be specified using --config
(-c
) option.
The equivalent options in a config file are as follows:
{
"tabWidth": 4,
"useTabs": true,
"keywordCase": "upper",
"linesBetweenQueries": 2
}
When used as a library, the indent
and uppercase
options have been replaced similarly.
New features
New SQL Dialects: GCP BigQuery, Apache Hive.
Lots of new configuration options. See the README for a full list.
Bugfixes and minor enhancements
- Added support for DB2 hex literals #123
- Added support for PL/SQL
$$ ... $$
quoted strings #183 - Added support for Postgres C-style escaped strings #198
- Scientific notation now supported for numbers #153
- Various fixes operator handling #125 #135 #150 #167 #176 #201
- Backtick-quoted identifiers and single-quoted strings now supported again in default
language: "sql"
#139 #147 #192 - Fixed formatting of
CHARACTER SET
#181 - The RETURNING keyword is now properly recognized in Postgres, MariaDB, N1QL and PL/SQL #196
- Improved STDOUT handling #194
- Fixed CLI command regressions #209 #210
- Fixed crash in Safary caused by regex look-behind inferrinizzard#84