pgsql-deparser 18.3.7 → 18.3.9

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.d.ts CHANGED
@@ -8,31 +8,6 @@ export interface DeparserOptions {
8
8
  functionDelimiterFallback?: string;
9
9
  pretty?: boolean;
10
10
  }
11
- /**
12
- * Deparser - Converts PostgreSQL AST nodes back to SQL strings
13
- *
14
- * Entry Points:
15
- * 1. ParseResult (from libpg-query) - The complete parse result
16
- * Structure: { version: number, stmts: RawStmt[] }
17
- * Note: stmts is "repeated RawStmt" in protobuf, so array contains RawStmt
18
- * objects inline (not wrapped as { RawStmt: ... } nodes)
19
- * Example: { version: 170004, stmts: [{ stmt: {...}, stmt_len: 32 }] }
20
- *
21
- * 2. Wrapped ParseResult - When explicitly wrapped as a Node
22
- * Structure: { ParseResult: { version: number, stmts: RawStmt[] } }
23
- *
24
- * 3. Wrapped RawStmt - When explicitly wrapped as a Node
25
- * Structure: { RawStmt: { stmt: Node, stmt_len?: number } }
26
- *
27
- * 4. Array of Nodes - Multiple statements to deparse
28
- * Can be: Node[] (e.g., SelectStmt, InsertStmt, etc.)
29
- *
30
- * 5. Single Node - Individual statement node
31
- * Example: { SelectStmt: {...} }, { InsertStmt: {...} }, etc.
32
- *
33
- * The deparser automatically detects bare ParseResult objects for backward
34
- * compatibility and wraps them internally for consistent processing.
35
- */
36
11
  export declare class Deparser implements DeparserVisitor {
37
12
  private tree;
38
13
  private options;
@@ -77,6 +52,7 @@ export declare class Deparser implements DeparserVisitor {
77
52
  visitBetweenRange(rexpr: any, context: DeparserContext): string;
78
53
  InsertStmt(node: t.InsertStmt, context: DeparserContext): string;
79
54
  UpdateStmt(node: t.UpdateStmt, context: DeparserContext): string;
55
+ formatUpdateAssignments(targets: Node[], context: DeparserContext): string;
80
56
  DeleteStmt(node: t.DeleteStmt, context: DeparserContext): string;
81
57
  WithClause(node: t.WithClause, context: DeparserContext): string;
82
58
  ResTarget(node: t.ResTarget, context: DeparserContext): string;
@@ -87,6 +63,7 @@ export declare class Deparser implements DeparserVisitor {
87
63
  deparseReturningList(list: t.Node[], context: DeparserContext): string;
88
64
  BoolExpr(node: t.BoolExpr, context: DeparserContext): string;
89
65
  FuncCall(node: t.FuncCall, context: DeparserContext): string;
66
+ formatOverClause(over: t.WindowDef, context: DeparserContext): string;
90
67
  FuncExpr(node: t.FuncExpr, context: DeparserContext): string;
91
68
  A_Const(node: t.A_Const, context: DeparserContext): string;
92
69
  ColumnRef(node: t.ColumnRef, context: DeparserContext): string;
@@ -123,10 +100,13 @@ export declare class Deparser implements DeparserVisitor {
123
100
  SubLink(node: t.SubLink, context: DeparserContext): string;
124
101
  CaseWhen(node: t.CaseWhen, context: DeparserContext): string;
125
102
  WindowDef(node: t.WindowDef, context: DeparserContext): string;
103
+ formatIdentityColumnOptions(def: Node, context: DeparserContext): string;
104
+ needsBExprParens(node: Node): boolean;
126
105
  formatWindowFrame(node: any, context: DeparserContext): string | null;
127
106
  SortBy(node: t.SortBy, context: DeparserContext): string;
128
107
  GroupingSet(node: t.GroupingSet, context: DeparserContext): string;
129
108
  CommonTableExpr(node: t.CommonTableExpr, context: DeparserContext): string;
109
+ formatAexprConst(node: Node, context: DeparserContext): string;
130
110
  ParamRef(node: t.ParamRef, context: DeparserContext): string;
131
111
  LockingClause(node: any, context: DeparserContext): string;
132
112
  MinMaxExpr(node: t.MinMaxExpr, context: DeparserContext): string;
@@ -284,7 +264,22 @@ export declare class Deparser implements DeparserVisitor {
284
264
  TableFunc(node: t.TableFunc, context: DeparserContext): string;
285
265
  RangeTableFunc(node: t.RangeTableFunc, context: DeparserContext): string;
286
266
  RangeTableFuncCol(node: t.RangeTableFuncCol, context: DeparserContext): string;
267
+ formatJsonFormat(format: t.JsonFormat | undefined): string | null;
268
+ formatJsonOutput(output: t.JsonOutput | undefined, context: DeparserContext): string | null;
269
+ formatJsonNullClause(absentOnNull: boolean | undefined): string;
270
+ formatJsonUniqueClause(unique: boolean | undefined): string | null;
271
+ JsonValueExpr(node: t.JsonValueExpr, context: DeparserContext): string;
272
+ JsonKeyValue(node: t.JsonKeyValue, context: DeparserContext): string;
273
+ JsonObjectConstructor(node: t.JsonObjectConstructor, context: DeparserContext): string;
274
+ JsonArrayConstructor(node: t.JsonArrayConstructor, context: DeparserContext): string;
287
275
  JsonArrayQueryConstructor(node: t.JsonArrayQueryConstructor, context: DeparserContext): string;
276
+ formatJsonAggSuffix(ctor: t.JsonAggConstructor | undefined, context: DeparserContext): string;
277
+ JsonObjectAgg(node: t.JsonObjectAgg, context: DeparserContext): string;
278
+ JsonArrayAgg(node: t.JsonArrayAgg, context: DeparserContext): string;
279
+ JsonParseExpr(node: t.JsonParseExpr, context: DeparserContext): string;
280
+ JsonScalarExpr(node: t.JsonScalarExpr, context: DeparserContext): string;
281
+ JsonSerializeExpr(node: t.JsonSerializeExpr, context: DeparserContext): string;
282
+ JsonIsPredicate(node: t.JsonIsPredicate, context: DeparserContext): string;
288
283
  RangeFunction(node: t.RangeFunction, context: DeparserContext): string;
289
284
  XmlExpr(node: t.XmlExpr, context: DeparserContext): string;
290
285
  schemaname(node: any, context: DeparserContext): string;