pgsql-deparser 17.18.3 → 17.18.4

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/deparser.js CHANGED
@@ -5008,7 +5008,8 @@ class Deparser {
5008
5008
  }
5009
5009
  output.push('SET EXPRESSION');
5010
5010
  if (node.def) {
5011
- output.push(this.visit(node.def, context));
5011
+ output.push('AS');
5012
+ output.push(context.parens(this.visit(node.def, context)));
5012
5013
  }
5013
5014
  break;
5014
5015
  case 'AT_DropExpression':
@@ -5017,6 +5018,9 @@ class Deparser {
5017
5018
  output.push(quotes_1.QuoteUtils.quoteIdentifier(node.name));
5018
5019
  }
5019
5020
  output.push('DROP EXPRESSION');
5021
+ if (node.missing_ok) {
5022
+ output.push('IF EXISTS');
5023
+ }
5020
5024
  break;
5021
5025
  case 'AT_CheckNotNull':
5022
5026
  output.push('ALTER COLUMN');
package/esm/deparser.js CHANGED
@@ -5005,7 +5005,8 @@ export class Deparser {
5005
5005
  }
5006
5006
  output.push('SET EXPRESSION');
5007
5007
  if (node.def) {
5008
- output.push(this.visit(node.def, context));
5008
+ output.push('AS');
5009
+ output.push(context.parens(this.visit(node.def, context)));
5009
5010
  }
5010
5011
  break;
5011
5012
  case 'AT_DropExpression':
@@ -5014,6 +5015,9 @@ export class Deparser {
5014
5015
  output.push(QuoteUtils.quoteIdentifier(node.name));
5015
5016
  }
5016
5017
  output.push('DROP EXPRESSION');
5018
+ if (node.missing_ok) {
5019
+ output.push('IF EXISTS');
5020
+ }
5017
5021
  break;
5018
5022
  case 'AT_CheckNotNull':
5019
5023
  output.push('ALTER COLUMN');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgsql-deparser",
3
- "version": "17.18.3",
3
+ "version": "17.18.4",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PostgreSQL AST Deparser",
6
6
  "main": "index.js",
@@ -60,5 +60,5 @@
60
60
  "@pgsql/quotes": "17.1.0",
61
61
  "@pgsql/types": "^17.6.2"
62
62
  },
63
- "gitHead": "16d4dced1144372f2debc270ea07e9d842cc50c9"
63
+ "gitHead": "987c0c66fee20025b193cb497d1ceb8832dc4ed2"
64
64
  }