pgsql-deparser 13.3.5 → 13.3.6

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,14 @@
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.6](https://github.com/pyramation/pgsql-parser/compare/pgsql-deparser@13.3.5...pgsql-deparser@13.3.6) (2022-04-19)
7
+
8
+ **Note:** Version bump only for package pgsql-deparser
9
+
10
+
11
+
12
+
13
+
6
14
  ## [13.3.5](https://github.com/pyramation/pgsql-parser/compare/pgsql-deparser@13.3.4...pgsql-deparser@13.3.5) (2022-04-19)
7
15
 
8
16
  **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) {
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgsql-deparser",
3
- "version": "13.3.5",
3
+ "version": "13.3.6",
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.6",
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": "9e241dc39d3469afe7908cd7e2e9f847efa43f6f"
79
79
  }