prettier-plugin-sql-cst 0.17.0 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -216,7 +216,8 @@ There are also several SQL-specific options:
216
216
  it will throw an error and won't format anything at all.
217
217
  With this option enabled, it will skip over SQL statements it doesn't recognize, leaving them as-is.
218
218
 
219
- **Deprecated:** This doesn't really work as advertised and will likely be removed.
219
+ **Deprecated:** Use conditional comments `/* sql-parser-cst-disable */` and
220
+ `/* sql-parser-cst-enable */` instead.
220
221
 
221
222
  _Since 0.12.0_
222
223
 
@@ -265,12 +266,16 @@ It also has experimental support for the following dialects:
265
266
  - MariaDB
266
267
 
267
268
  The main limitation is that [the parser][sql-parser-cst] does not support full syntax of
268
- these dialects. One should expect the parser to crash for syntax that's more specific to
269
- these dialects. But as long as the parsing succeeds, the formatting should also succeed.
270
- Mainly one can expect the formatting of SELECT, INSERT, UPDATE, DELETE statements to work.
269
+ these dialects. To overcome this limitation you can use conditional comments
270
+ to disable parsing of the problematic section of SQL:
271
271
 
272
- To overcome this limitation you can enable the `sqlAcceptUnsupportedGrammar` option,
273
- which will make the plugin skip the SQL statements it doesn't recognize.
272
+ ```sql
273
+ SELECT * FROM products;
274
+ /* sql-parser-cst-disable */
275
+ UNSUPPORTED SQL IN HERE;
276
+ /* sql-parser-cst-enable */
277
+ UPDATE products SET sold = true WHERE id = 2;
278
+ ```
274
279
 
275
280
  The specifics of the [SQL formatting style][STYLE_GUIDE] are still very much subject to change.
276
281
  Though the general principles should be mostly in place by now.
@@ -145,6 +145,7 @@ exports.exprMap = {
145
145
  interval_expr: function (print) { return print.spaced(["intervalKw", "expr", "unit"]); },
146
146
  interval_unit_range: function (print) { return print.spaced(["fromUnit", "toKw", "toUnit"]); },
147
147
  interval_unit: function (print) { return print("unitKw"); },
148
+ array_literal_expr: function (print) { return print(["arrayKw", "expr"]); },
148
149
  array_expr: function (print) {
149
150
  return (0, print_utils_1.group)(["[", (0, print_utils_1.indent)([print_utils_1.softline, print("expr")]), print_utils_1.softline, "]"]);
150
151
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prettier-plugin-sql-cst",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "description": "Prettier plugin for SQL",
5
5
  "contributors": [
6
6
  "Barna Magyarkuti <bmagyarkuti@gmail.com>",
@@ -37,7 +37,7 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "prettier": "^3.0.3",
40
- "sql-parser-cst": "^0.37.0"
40
+ "sql-parser-cst": "^0.37.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/jest": "^29.2.5",