pgsql-deparser 13.3.5 → 13.3.8

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/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [13.3.8](https://github.com/pyramation/pgsql-parser/compare/pgsql-deparser@13.3.7...pgsql-deparser@13.3.8) (2022-04-19)
7
+
8
+ **Note:** Version bump only for package pgsql-deparser
9
+
10
+
11
+
12
+
13
+
14
+ ## [13.3.7](https://github.com/pyramation/pgsql-parser/compare/pgsql-deparser@13.3.6...pgsql-deparser@13.3.7) (2022-04-19)
15
+
16
+ **Note:** Version bump only for package pgsql-deparser
17
+
18
+
19
+
20
+
21
+
22
+ ## [13.3.6](https://github.com/pyramation/pgsql-parser/compare/pgsql-deparser@13.3.5...pgsql-deparser@13.3.6) (2022-04-19)
23
+
24
+ **Note:** Version bump only for package pgsql-deparser
25
+
26
+
27
+
28
+
29
+
6
30
  ## [13.3.5](https://github.com/pyramation/pgsql-parser/compare/pgsql-deparser@13.3.4...pgsql-deparser@13.3.5) (2022-04-19)
7
31
 
8
32
  **Note:** Version bump only for package pgsql-deparser
package/main/deparser.js CHANGED
@@ -1412,9 +1412,18 @@ var Deparser = /*#__PURE__*/function () {
1412
1412
  key: 'IndexElem',
1413
1413
  value: function IndexElem(node) {
1414
1414
  var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1415
+ var output = [];
1415
1416
 
1416
1417
  if (node.name) {
1417
- return node.name;
1418
+ output.push(node.name);
1419
+
1420
+ if (node.ordering === 'SORTBY_DESC') {
1421
+ output.push('DESC');
1422
+ } else if (node.ordering === 'SORTBY_ASC') {
1423
+ output.push('ASC');
1424
+ }
1425
+
1426
+ return output.join(' ');
1418
1427
  }
1419
1428
 
1420
1429
  if (node.expr) {
@@ -3713,6 +3722,8 @@ var Deparser = /*#__PURE__*/function () {
3713
3722
  return _this20.deparse(arg, context);
3714
3723
  }).join(','));
3715
3724
  output.push(')');
3725
+ } else if (!node.args_unspecified) {
3726
+ output.push('()');
3716
3727
  }
3717
3728
 
3718
3729
  return output.join(' ');
@@ -1275,8 +1275,18 @@ export default class Deparser {
1275
1275
  }
1276
1276
 
1277
1277
  ['IndexElem'](node, context = {}) {
1278
+ const output = [];
1279
+
1278
1280
  if (node.name) {
1279
- return node.name;
1281
+ output.push(node.name);
1282
+
1283
+ if (node.ordering === 'SORTBY_DESC') {
1284
+ output.push('DESC');
1285
+ } else if (node.ordering === 'SORTBY_ASC') {
1286
+ output.push('ASC');
1287
+ }
1288
+
1289
+ return output.join(' ');
1280
1290
  }
1281
1291
 
1282
1292
  if (node.expr) {
@@ -3411,6 +3421,8 @@ export default class Deparser {
3411
3421
  return this.deparse(arg, context);
3412
3422
  }).join(','));
3413
3423
  output.push(')');
3424
+ } else if (!node.args_unspecified) {
3425
+ output.push('()');
3414
3426
  }
3415
3427
 
3416
3428
  return output.join(' ');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgsql-deparser",
3
- "version": "13.3.5",
3
+ "version": "13.3.8",
4
4
  "description": "PostgreSQL AST Deparser",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "homepage": "https://github.com/pyramation/pgsql-parser",
@@ -65,7 +65,7 @@
65
65
  "eslint-plugin-prettier": "^3.1.2",
66
66
  "glob": "7.1.6",
67
67
  "jest": "^25.1.0",
68
- "pgsql-parser": "^13.3.5",
68
+ "pgsql-parser": "^13.3.8",
69
69
  "prettier": "^2.1.2",
70
70
  "regenerator-runtime": "^0.13.2"
71
71
  },
@@ -75,5 +75,5 @@
75
75
  "lodash": "^4.17.20",
76
76
  "pgsql-enums": "^13.1.2"
77
77
  },
78
- "gitHead": "ed7ccd5b72727e35fb4d081203101a90b3ed6ddc"
78
+ "gitHead": "b5341b62b3fa7d239ba8a285382d9ffda0deacfd"
79
79
  }