Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency sql-formatter to v12 #520

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 29, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
sql-formatter ^8.2.0 -> ^12.0.0 age adoption passing confidence

Release Notes

sql-formatter-org/sql-formatter (sql-formatter)

v12.2.3: 12.2.3

Compare Source

Bugfixes
  • Add SELECT..INTO support for TSQL (#​609) (thanks to Grant Forsythe)

v12.2.2: 12.2.2

Compare Source

Bugfixes
  • Improve handling of GO statements in Transact-SQL (#​606) (thanks to Grant Forsythe)

v12.2.1: 12.2.1

Compare Source

Bugfixes
  • Support named arguments for BigQuery (#​603) (thanks to pokutuna)

v12.2.0: 12.2.0

Compare Source

New feature

  • Custom paramTypes config (#​582)

v12.1.4: 12.1.4

Compare Source

  • Export ParamItems and ParamTypes at top level #​577

v12.1.3: 12.1.3

Compare Source

Bugfixes
  • Add FOR UPDATE clause support for Postgres (#​574) (thanks to Nathan Walters)

v12.1.2: 12.1.2

Compare Source

Enhancements
  • Support BigQuery system variables (#​568)

v12.1.1: 12.1.1

Compare Source

Bugfixes
  • Fix long-standing bug: BETWEEN operator followed by AND operator no more causes a crash (#​566)
  • Fix formatting of IS [NOT] DISTINCT FROM operator (#​565)
  • Improve formatting of block comments that aren't doc-comments (#​559)

v12.1.0: 12.1.0

Compare Source

New feature

  • New command line flag --fix for formatting files in-place (#​406)

v12.0.6: 12.0.6

Compare Source

Bugfix
  • Allow DB2 identifiers to start with $, @, # chars #​550

v12.0.5: 12.0.5

Compare Source

Bugfixes
  • Fixed trailing comment handling with commaPosition option (thanks to Stanislav Germanovskii) #​505
Dependency updates
  • Bumped json5 from 1.0.1 to 1.0.2 (#​548)

v12.0.4: 12.0.4

Compare Source

Bugfixes
  • Fix formatting of ON CONFLICT clause (#​535)
  • Support QUALIFY clause in Snowflake (#​539)

v12.0.3: 12.0.3

Compare Source

Bugfixes
  • Add missing operators to SingleStoreDB (#​531) (thanks to Tito Griné)

v12.0.2: 12.0.2

Compare Source

Bugfixes

v12.0.1: 12.0.1

Compare Source

Bugfixes
  • Export ConfigError class as value, not as type (#​521)

v12.0.0: 12.0.0

Compare Source

Major formatting style change

Most of the simple statements are now formatted more 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;
New API for smaller bundle size

When using the format() function, all the dialects need to be loaded because the actual dialect is determined at runtime. Which means a bundler like Webpack will need to bundle up code of all the dialects even when just a single one is needed. This will be something like 4x overhead compared to bundling just a single dialect.

There's now a new API which enables tree-shaking to eliminate the code of unused dialects:

import { formatDialect, sqlite } from "sql-formatter";

formatDialect("SELECT * FROM tbl", { dialect: sqlite });

See the docs for details.

Related issues/PRs: #​511 #​515 #​452

Breaking changes in extension API

The above change also breaks the current extension API. Notably the language parameter no more works for specifying a custom dialect. Instead use the new formatDialect() API for the same purpose.

Also, instead of extending the Formatter class, there's now a DialectOptions object (#​493). So one no more needs to extend a class, but can simply provide a config object.

Other new features
  • Support for custom quote types (in custom dialect config) #​516 #​503
Bugfixes
  • Support named function arguments in Trino with => operator #​510
  • Add package.json to list of exports #​499
  • Support nested CASE expressions #​494
  • The MySQL USE keyword formatting should no more cause syntax error #​456

v11.0.2: 11.0.2

Compare Source

Bugfixes
  • Fix indentation of first comment in file #​481

v11.0.1: 11.0.1

Compare Source

Bugfixes
  • Fix ESM/TypeScript module resolution #​487 #​488 (thanks to An Phi)

v11.0.0: 11.0.0

Compare Source

Potentially breaking changes
New features
  • Added support for Snowflake dialect #​454
Improvements
  • Better CASE expression formatting #​458, #​401, #​459
  • Better formatting of inline block-comments #​462
  • Better ON UPDATE/DELETE constraints formatting #​478
  • denseOperators config now also applies to : operator.

v10.7.2: 10.7.2

Compare Source

Bugfixes
  • Support empty SELECT; statement #​447

v10.7.1: 10.7.1

Compare Source

Bugfixes
  • Add support for Redshift type-cast operator #​450

v10.7.0: 10.7.0

Compare Source

Improvements
  • Error messages now contain line and column number #​442
Internals
  • Comments are now attached to AST nodes #​439
  • Eliminated end index from Token, only the start index is only ever needed #​440 #​448

v10.6.0: 10.6.0

Compare Source

Bugfixes

  • Parenthesized expression length is now calculated correctly when it contains replaced parameters #​245
  • Parenthesized expression length calculation now also takes account denseOperators option.

Internal changes

  • Rewrite of inline block formatting logic #​429

v10.5.1: 10.5.1

Compare Source

Bugfixes
  • Fix error with ident.* syntax #​430
  • Add missing || operator to default SQL dialect #​433

v10.5.0: 10.5.0

Compare Source

Enhancements
  • Add language: transactsql as alias for tsql #​427

v10.4.0: 10.4.0

Compare Source

Bugfixes
  • Fix parse error in BETWEEN expressions that use tbl.col syntax #​423
  • Don't support backslash escapes when SQL dialect only supports repeated-quote escapes #​308
Mildly breaking changes
  • All strings and identifiers no more support all kinds of escaping (e.g. both \" and "") #​425
  • Unclosed strings/quoted-identifiers (like "...) are no more supported #​425
  • All possible single-char operators are no more supported in all dialects (only operators specific to the dialect) #​426

v10.3.0: 10.3.0

Compare Source

Improvements
  • Support nested block comments in PostgreSQL and Transact-SQL #​422 #​411
Mildly breaking changes
  • Unclosed block comments (like /* ...) will now produce an error

v10.2.0: 10.2.0

Compare Source

Bugfixes
  • Fix formatting of TIMESTAMP WITH TIME ZONE in PostgreSQL #​391
  • Fix formatting of FOR UPDATE clause in PL/SQL #​340
Internal changes
  • Reduce coupling between Tokenizer and TokenizerEngine #​416

v10.1.1: 10.1.1

Compare Source

Bugfixes
  • Fix crash caused by ROWS BETWEEN in window definitions #​417 #​415

v10.1.0: 10.1.0

Compare Source

Improvements
  • Add support for @@​variables in MariaDB, MySQL, SingleStoreDB #​410
  • Remove support of prefixes from double-quoted strings inMariaDB, MySQL, SingleStoreDB (shouldn't break unless you're for some reason formatting invalid code) #​408
Bugfixes
  • Fix tabular style formatting of LIMIT clause #​412
Internal changes
  • Remove unnecessary type imports, improving compatibility with older TypeScript versions #​404
  • Remove Tokens from AST #​403

v10.0.0: 10.0.0

Compare Source

Breaking changes
  • Encountering braces {} or brackets [] in SQL dialect not supporting these will now throw error #​400
  • Encountering unbalanced parenthesis () (also {} and []) will now produce an error #​277
Performance
  • Tokenizer is now faster, thanks to removal of case-insensitive regex transform #​394
  • Parser is now slower, because of the switch to nearley #​277
  • Overall performance is more impacted by the parser, so the net result is a slower formatting. Though this should only affect you if you're formatting megabytes worth of SQL.
Internal changes
  • Switch from hand-written parser to Nearley parser-generator #​277
  • Added more token types #​398 #​395
  • Replace open- and closeParens configs with extraParens #​405

v9.2.0: 9.2.0

Compare Source

New features:
  • Added paramTypes config option to allow user-configured parameter placeholder types #​367
  • Extended language option to allow for passing in a user-defined Formatter class #​306
Improvements:
  • Better handling of line-comments, preserving their position either at the end of line or between lines #​365

v9.1.0: 9.1.0

Compare Source

New features
  • New SQL dialect: SingleStoreDB (thanks to Michael Giannakopoulos) #​387 #​379
Improvements
  • An error is now thrown when the aliasAs config (removed in 9.0.0) is used #​389

v9.0.1: 9.0.1

Compare Source

Bugfixes:
  • Fix set operations indentation in tabular style #​383
Internals:
  • Add location info to tokens #​374

v9.0.0: 9.0.0

Compare Source

Breaking changes

  • Removed aliasAs config option #​371
  • New approach to function call matching #​140 see beta1 release notes for details
  • Removed support for lots of questionable DB2 keywords #​352
  • LIMIT & OFFSET keywords are no more supported in all dialects #​362
  • Removed support for CREATE TABLE and DROP TABLE from N1QL #​364
  • Several other smaller removals of unsupported syntax.

New features

  • New SQL dialect: Trino (Thanks for the work of Boris Verkhovskiy #​325 #​297 )

Improvements

  • Improved support for various BigQuery DDL statements (thanks to Ahmad Khan #​319)
  • Improved formatting of PL/SQL tbl@dblink syntax #​338
  • Added support for PL/SQL Q strings #​342
  • Improved Trino row pattern formatting #​333
  • Revised reserved keyword lists in multiple dialects #​348
  • Revised supported joins and set operations in multiple dialects #​346
  • Revised supported string types in multiple dialects #​332
  • Allow # as first char for Redshift identifiers #​358
  • Allow MySQL and MariaDB identifiers to begin with a number #​339
  • Improved formatting of SELECT DISTINCT #​362
  • Added support for several variations in SELECT query clauses (like WITH RECURSIVE in addition to plain WITH) #​362
  • General overhaul of supported SQL syntax #​362, #​375, #​369, #​364

Bugfixes

  • Fixed parameter substitution not working in BETWEEN expressions #​318
  • Fixed BETWEEN..AND formatting in tabular style #​350
  • Fixed double-quoted strings support for Spark #​331
  • Fixed multiword commands formatting with keywordCase:upper #​356
  • Fixed missing type-definition file when importing sql-formatter in TypeScript #​353
  • Fixed semicolon-on-separate-line bug #​376

Internals:

  • Utility for auto-generation of syntax variants #​327
  • Placed each language.formatter.ts file to separate directory and separated functions and keywords to separate files #​315
  • Removed RESERVED_JOIN_CONDITION token type.
  • Renamed BINARY_COMMAND to SET_OPERATION #​351
  • Separated multi-word keywords from the rest #​363
  • Removed .d.ts file extensions #​370

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@vercel
Copy link

vercel bot commented Jun 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
it-tools ✅ Ready (Inspect) Visit Preview Aug 21, 2023 4:29pm

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@CorentinTh CorentinTh merged commit 2bcb77a into main Aug 21, 2023
@CorentinTh CorentinTh deleted the renovate/sql-formatter-12.x branch August 21, 2023 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant