sql-formatter
Advanced tools
Comparing version 12.1.2 to 12.1.3
@@ -7,3 +7,3 @@ import { expandPhrases } from '../../expandPhrases.js'; | ||
const reservedClauses = expandPhrases([// queries | ||
'WITH', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'PARTITION BY', 'ORDER [SIBLINGS] BY', 'OFFSET', 'FETCH {FIRST | NEXT}', 'FOR UPDATE', // Data manipulation | ||
'WITH', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'PARTITION BY', 'ORDER [SIBLINGS] BY', 'OFFSET', 'FETCH {FIRST | NEXT}', 'FOR UPDATE [OF]', // Data manipulation | ||
// - insert: | ||
@@ -10,0 +10,0 @@ 'INSERT [INTO | ALL INTO]', 'VALUES', // - update: |
@@ -6,3 +6,3 @@ import { expandPhrases } from '../../expandPhrases.js'; | ||
const reservedClauses = expandPhrases([// queries | ||
'WITH [RECURSIVE]', 'FROM', 'WHERE', 'GROUP BY [ALL | DISTINCT]', 'HAVING', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'LIMIT', 'OFFSET', 'FETCH {FIRST | NEXT}', // Data manipulation | ||
'WITH [RECURSIVE]', 'FROM', 'WHERE', 'GROUP BY [ALL | DISTINCT]', 'HAVING', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'LIMIT', 'OFFSET', 'FETCH {FIRST | NEXT}', 'FOR {UPDATE | NO KEY UPDATE | SHARE | KEY SHARE} [OF]', // Data manipulation | ||
// - insert: | ||
@@ -9,0 +9,0 @@ 'INSERT INTO', 'VALUES', // - update: |
{ | ||
"name": "sql-formatter", | ||
"version": "12.1.2", | ||
"version": "12.1.3", | ||
"description": "Format whitespace in a SQL query to make it more readable", | ||
@@ -68,2 +68,3 @@ "license": "MIT", | ||
"Michael Giannakopoulos <mgiannakopoulos@singlestore.com>", | ||
"Nathan Walters <nwalters512@gmail.com>", | ||
"Nicolas Dermine <nicolas.dermine@gmail.com>", | ||
@@ -70,0 +71,0 @@ "Offir Baron <ofir@panoply.io>", |
@@ -196,2 +196,40 @@ <a href='https://github.com/sql-formatter-org/sql-formatter'><img src="static/prettier-sql-clean.svg" width="128"/></a> | ||
### Module parse failed: Unexpected token | ||
This typically happens when bundling an appication with Webpack. | ||
The cause is that Babel (through `babel-loader`) is not configured | ||
to support class properties syntax: | ||
``` | ||
| export default class ExpressionFormatter { | ||
> inline = false; | ||
``` | ||
This syntax is widely supported in all major browsers (except old IE) | ||
and support for it is included to the default `@babel/preset-env`. | ||
Possible fixes: | ||
- Update to newer Babel / Webpack | ||
- Switch to `@babel/preset-env` | ||
- Include plugin `@babel/plugin-proposal-class-properties` | ||
## The future | ||
The development of this formatter is currently in maintenance mode. | ||
Bugs will get fixed if feasible, but new features will likely not be added. | ||
I have started a new SQL formatting tool: [prettier-plugin-sql-cst][]. | ||
- It solves several problems which can't be fixed in SQL Formatter because | ||
of fundamental problems in its arhictecture. | ||
- It makes use of the Prettier layout algorithm, | ||
doing a better job of splitting long expressions to multiple lines. | ||
- It takes much more opinionated approach to SQL formatting, | ||
giving only a very limited set of options to adjust the code style. | ||
- It already has full support for SQLite and BigQuery syntax. | ||
It should work for the most common SQL code in various other dialects. | ||
Give it a try if you'd like to take your SQL auto-formatting to the next level. | ||
## Contributing | ||
@@ -206,1 +244,2 @@ | ||
[php library]: https://github.com/jdorn/sql-formatter | ||
[prettier-plugin-sql-cst]: https://github.com/nene/prettier-plugin-sql-cst |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2165338
244