@@ -120,6 +120,108 @@ function transform13To14NodeArray(nodes?: PG13Node[]): PG14Node[] | undefined {
120120
121121function transform13To14OptionalNode ( node ?: PG13Node ) : PG14Node | undefined {
122122 return node ? transform13To14 ( node ) : undefined ;
123+ function transform13To14FromExpr ( fromExpr ?: PG13Types . FromExpr ) : PG14Types . FromExpr | undefined {
124+ if ( ! fromExpr ) return undefined ;
125+ return {
126+ fromlist : transform13To14NodeArray ( fromExpr . fromlist ) ,
127+ quals : transform13To14OptionalNode ( fromExpr . quals )
128+ } ;
129+ }
130+
131+ function transform13To14OnConflictExpr ( onConflict ?: PG13Types . OnConflictExpr ) : PG14Types . OnConflictExpr | undefined {
132+ if ( ! onConflict ) return undefined ;
133+ return {
134+ action : onConflict . action ,
135+ arbiterElems : transform13To14NodeArray ( onConflict . arbiterElems ) ,
136+ arbiterWhere : transform13To14OptionalNode ( onConflict . arbiterWhere ) ,
137+ constraint : onConflict . constraint ,
138+ onConflictSet : transform13To14NodeArray ( onConflict . onConflictSet ) ,
139+ onConflictWhere : transform13To14OptionalNode ( onConflict . onConflictWhere ) ,
140+ exclRelIndex : onConflict . exclRelIndex ,
141+ exclRelTlist : transform13To14NodeArray ( onConflict . exclRelTlist )
142+ } ;
143+ }
144+
145+ function transform13To14IntoClause ( intoClause ?: PG13Types . IntoClause ) : PG14Types . IntoClause | undefined {
146+ if ( ! intoClause ) return undefined ;
147+ return {
148+ rel : intoClause . rel ? transform13To14RangeVar ( intoClause . rel ) : undefined ,
149+ colNames : transform13To14NodeArray ( intoClause . colNames ) ,
150+ accessMethod : intoClause . accessMethod ,
151+ options : transform13To14NodeArray ( intoClause . options ) ,
152+ onCommit : intoClause . onCommit ,
153+ tableSpaceName : intoClause . tableSpaceName ,
154+ viewQuery : transform13To14OptionalNode ( intoClause . viewQuery ) ,
155+ skipData : intoClause . skipData
156+ } ;
157+ }
158+
159+ function transform13To14WithClause ( withClause ?: PG13Types . WithClause ) : PG14Types . WithClause | undefined {
160+ if ( ! withClause ) return undefined ;
161+ return {
162+ ctes : transform13To14NodeArray ( withClause . ctes ) ,
163+ recursive : withClause . recursive ,
164+ location : withClause . location
165+ } ;
166+ }
167+
168+ function transform13To14SelectStmtNode ( selectStmt ?: PG13Types . SelectStmt ) : PG14Types . SelectStmt | undefined {
169+ if ( ! selectStmt ) return undefined ;
170+ return transform13To14SelectStmt ( selectStmt ) ;
171+ }
172+
173+
174+ function transform13To14FromExpr ( fromExpr ?: PG13Types . FromExpr ) : PG14Types . FromExpr | undefined {
175+ if ( ! fromExpr ) return undefined ;
176+ return {
177+ fromlist : transform13To14NodeArray ( fromExpr . fromlist ) ,
178+ quals : transform13To14OptionalNode ( fromExpr . quals )
179+ } ;
180+ }
181+
182+ function transform13To14OnConflictExpr ( onConflict ?: PG13Types . OnConflictExpr ) : PG14Types . OnConflictExpr | undefined {
183+ if ( ! onConflict ) return undefined ;
184+ return {
185+ action : onConflict . action ,
186+ arbiterElems : transform13To14NodeArray ( onConflict . arbiterElems ) ,
187+ arbiterWhere : transform13To14OptionalNode ( onConflict . arbiterWhere ) ,
188+ constraint : onConflict . constraint ,
189+ onConflictSet : transform13To14NodeArray ( onConflict . onConflictSet ) ,
190+ onConflictWhere : transform13To14OptionalNode ( onConflict . onConflictWhere ) ,
191+ exclRelIndex : onConflict . exclRelIndex ,
192+ exclRelTlist : transform13To14NodeArray ( onConflict . exclRelTlist )
193+ } ;
194+ }
195+
196+ function transform13To14IntoClause ( intoClause ?: PG13Types . IntoClause ) : PG14Types . IntoClause | undefined {
197+ if ( ! intoClause ) return undefined ;
198+ return {
199+ rel : intoClause . rel ? transform13To14RangeVar ( intoClause . rel ) : undefined ,
200+ colNames : transform13To14NodeArray ( intoClause . colNames ) ,
201+ accessMethod : intoClause . accessMethod ,
202+ options : transform13To14NodeArray ( intoClause . options ) ,
203+ onCommit : intoClause . onCommit ,
204+ tableSpaceName : intoClause . tableSpaceName ,
205+ viewQuery : transform13To14OptionalNode ( intoClause . viewQuery ) ,
206+ skipData : intoClause . skipData
207+ } ;
208+ }
209+
210+ function transform13To14WithClause ( withClause ?: PG13Types . WithClause ) : PG14Types . WithClause | undefined {
211+ if ( ! withClause ) return undefined ;
212+ return {
213+ ctes : transform13To14NodeArray ( withClause . ctes ) ,
214+ recursive : withClause . recursive ,
215+ location : withClause . location
216+ } ;
217+ }
218+
219+ function transform13To14SelectStmtNode ( selectStmt ?: PG13Types . SelectStmt ) : PG14Types . SelectStmt | undefined {
220+ if ( ! selectStmt ) return undefined ;
221+ return transform13To14SelectStmt ( selectStmt ) ;
222+ }
223+
224+
123225}
124226
125227function transform13To14ParseResult ( result : PG13Types . ParseResult ) : PG14Types . ParseResult {
@@ -267,7 +369,7 @@ function transform13To14Aggref(aggref: PG13Types.Aggref): PG14Types.Aggref {
267369
268370function transform13To14Query ( query : PG13Types . Query ) : PG14Types . Query {
269371 return {
270- commandType : query . commandType ,
372+ commandType : query . commandType as any , // Handle enum conversion
271373 querySource : query . querySource ,
272374 canSetTag : query . canSetTag ,
273375 utilityStmt : transform13To14OptionalNode ( query . utilityStmt ) ,
@@ -284,10 +386,10 @@ function transform13To14Query(query: PG13Types.Query): PG14Types.Query {
284386 isReturn : query . isReturn ,
285387 cteList : transform13To14NodeArray ( query . cteList ) ,
286388 rtable : transform13To14NodeArray ( query . rtable ) ,
287- jointree : transform13To14OptionalNode ( query . jointree ) ,
389+ jointree : transform13To14FromExpr ( query . jointree ) ,
288390 targetList : transform13To14NodeArray ( query . targetList ) ,
289391 override : query . override ,
290- onConflict : transform13To14OptionalNode ( query . onConflict ) ,
392+ onConflict : transform13To14OnConflictExpr ( query . onConflict ) ,
291393 returningList : transform13To14NodeArray ( query . returningList ) ,
292394 groupClause : transform13To14NodeArray ( query . groupClause ) ,
293395 groupingSets : transform13To14NodeArray ( query . groupingSets ) ,
@@ -310,7 +412,7 @@ function transform13To14Query(query: PG13Types.Query): PG14Types.Query {
310412function transform13To14SelectStmt ( selectStmt : PG13Types . SelectStmt ) : PG14Types . SelectStmt {
311413 return {
312414 distinctClause : transform13To14NodeArray ( selectStmt . distinctClause ) ,
313- intoClause : transform13To14OptionalNode ( selectStmt . intoClause ) as PG14Types . IntoClause | undefined ,
415+ intoClause : transform13To14IntoClause ( selectStmt . intoClause ) ,
314416 targetList : transform13To14NodeArray ( selectStmt . targetList ) ,
315417 fromClause : transform13To14NodeArray ( selectStmt . fromClause ) ,
316418 whereClause : transform13To14OptionalNode ( selectStmt . whereClause ) ,
@@ -324,11 +426,11 @@ function transform13To14SelectStmt(selectStmt: PG13Types.SelectStmt): PG14Types.
324426 limitCount : transform13To14OptionalNode ( selectStmt . limitCount ) ,
325427 limitOption : selectStmt . limitOption ,
326428 lockingClause : transform13To14NodeArray ( selectStmt . lockingClause ) ,
327- withClause : transform13To14OptionalNode ( selectStmt . withClause ) as PG14Types . WithClause | undefined ,
429+ withClause : transform13To14WithClause ( selectStmt . withClause ) ,
328430 op : selectStmt . op ,
329431 all : selectStmt . all ,
330- larg : transform13To14OptionalNode ( selectStmt . larg ) as PG14Types . SelectStmt | undefined ,
331- rarg : transform13To14OptionalNode ( selectStmt . rarg ) as PG14Types . SelectStmt | undefined
432+ larg : transform13To14SelectStmtNode ( selectStmt . larg ) ,
433+ rarg : transform13To14SelectStmtNode ( selectStmt . rarg )
332434 } ;
333435}
334436
@@ -364,6 +466,57 @@ function transform13To14RawStmt(rawStmt: PG13Types.RawStmt): PG14Types.RawStmt {
364466 stmt_location : rawStmt . stmt_location ,
365467 stmt_len : rawStmt . stmt_len
366468 } ;
469+ function transform13To14FromExpr ( fromExpr ?: PG13Types . FromExpr ) : PG14Types . FromExpr | undefined {
470+ if ( ! fromExpr ) return undefined ;
471+ return {
472+ fromlist : transform13To14NodeArray ( fromExpr . fromlist ) ,
473+ quals : transform13To14OptionalNode ( fromExpr . quals )
474+ } ;
475+ }
476+
477+ function transform13To14OnConflictExpr ( onConflict ?: PG13Types . OnConflictExpr ) : PG14Types . OnConflictExpr | undefined {
478+ if ( ! onConflict ) return undefined ;
479+ return {
480+ action : onConflict . action ,
481+ arbiterElems : transform13To14NodeArray ( onConflict . arbiterElems ) ,
482+ arbiterWhere : transform13To14OptionalNode ( onConflict . arbiterWhere ) ,
483+ constraint : onConflict . constraint ,
484+ onConflictSet : transform13To14NodeArray ( onConflict . onConflictSet ) ,
485+ onConflictWhere : transform13To14OptionalNode ( onConflict . onConflictWhere ) ,
486+ exclRelIndex : onConflict . exclRelIndex ,
487+ exclRelTlist : transform13To14NodeArray ( onConflict . exclRelTlist )
488+ } ;
489+ }
490+
491+ function transform13To14IntoClause ( intoClause ?: PG13Types . IntoClause ) : PG14Types . IntoClause | undefined {
492+ if ( ! intoClause ) return undefined ;
493+ return {
494+ rel : intoClause . rel ? transform13To14RangeVar ( intoClause . rel ) : undefined ,
495+ colNames : transform13To14NodeArray ( intoClause . colNames ) ,
496+ accessMethod : intoClause . accessMethod ,
497+ options : transform13To14NodeArray ( intoClause . options ) ,
498+ onCommit : intoClause . onCommit ,
499+ tableSpaceName : intoClause . tableSpaceName ,
500+ viewQuery : transform13To14OptionalNode ( intoClause . viewQuery ) ,
501+ skipData : intoClause . skipData
502+ } ;
503+ }
504+
505+ function transform13To14WithClause ( withClause ?: PG13Types . WithClause ) : PG14Types . WithClause | undefined {
506+ if ( ! withClause ) return undefined ;
507+ return {
508+ ctes : transform13To14NodeArray ( withClause . ctes ) ,
509+ recursive : withClause . recursive ,
510+ location : withClause . location
511+ } ;
512+ }
513+
514+ function transform13To14SelectStmtNode ( selectStmt ?: PG13Types . SelectStmt ) : PG14Types . SelectStmt | undefined {
515+ if ( ! selectStmt ) return undefined ;
516+ return transform13To14SelectStmt ( selectStmt ) ;
517+ }
518+
519+
367520}
368521
369522function transformA_Const ( aConst : PG13Types . A_Const ) : PG17Types . A_Const {
0 commit comments