squawk_parser/
ast.rs

1use serde::{Deserialize, Serialize};
2use serde_json::Value;
3use serde_repr::{Deserialize_repr, Serialize_repr};
4
5#[derive(Serialize_repr, Deserialize_repr, PartialEq, Debug)]
6#[repr(u8)]
7pub enum TransactionStmtKind {
8    Begin,
9    /// semantically identical to BEGIN
10    Start,
11    Commit,
12    Rollback,
13    Savepoint,
14    Release,
15    RollbackTo,
16    Prepare,
17    CommitPrepared,
18    RollbackPrepared,
19}
20
21#[derive(Debug, Deserialize, Serialize)]
22pub struct TransactionStmt {
23    pub kind: TransactionStmtKind,
24}
25
26#[derive(Debug, Deserialize, Serialize)]
27pub struct RawStmt {
28    pub stmt: Stmt,
29    #[serde(default)]
30    pub stmt_location: i32,
31    /// None when the statement doesn't have a closing semicolon
32    pub stmt_len: Option<i32>,
33}
34
35#[derive(Serialize_repr, Deserialize_repr, PartialEq, Debug)]
36#[repr(u8)]
37pub enum SetOperation {
38    None,
39    Union,
40    Intersect,
41    Except,
42}
43
44impl Default for SetOperation {
45    fn default() -> Self {
46        Self::None
47    }
48}
49
50#[derive(Debug, Deserialize, Serialize)]
51pub enum SelectChild {
52    SelectStmt(SelectStmt),
53}
54
55#[derive(Debug, Deserialize, Serialize)]
56pub struct SelectStmt {
57    //
58    // These fields are used only in "leaf" SelectStmts.
59    //
60    /// NULL, list of DISTINCT ON exprs, or lcons(NIL,NIL) for all (SELECT
61    /// DISTINCT)
62    #[serde(rename = "distinctClause")]
63    pub distinct_clause: Option<Value>,
64    // target for SELECT INTO
65    #[serde(rename = "intoClause")]
66    pub into_clause: Option<Value>,
67    /// the target list (of ResTarget)
68    #[serde(rename = "targetList")]
69    pub target_list: Option<Vec<Value>>,
70    /// the FROM clause
71    #[serde(rename = "fromClause")]
72    pub from_clause: Option<Value>,
73    /// WHERE qualification
74    #[serde(rename = "whereClause")]
75    pub where_clause: Option<Value>,
76    /// GROUP BY clauses
77    #[serde(rename = "groupClause")]
78    pub group_clause: Option<Value>,
79    /// HAVING conditional-expression
80    #[serde(rename = "havingClause")]
81    pub having_clause: Option<Value>,
82    /// WINDOW window_name AS (...), ...
83    #[serde(rename = "windowClause")]
84    pub window_clause: Option<Value>,
85
86    //
87    // In a "leaf" node representing a VALUES list, the above fields are all
88    // null, and instead this field is set.  Note that the elements of the
89    // sublists are just expressions, without ResTarget decoration. Also note
90    // that a list element can be DEFAULT (represented as a SetToDefault
91    // node), regardless of the context of the VALUES list. It's up to parse
92    // analysis to reject that where not valid.
93    //
94    /// untransformed list of expression lists
95    #[serde(rename = "valuesLists")]
96    values_lists: Option<Value>,
97
98    //
99    // These fields are used in both "leaf" SelectStmts and upper-level
100    // SelectStmts.
101    //
102    /// sort clause (a list of SortBy's)
103    #[serde(rename = "sortClause")]
104    sort_clause: Option<Value>,
105    /// # of result tuples to skip
106    #[serde(rename = "limitOffset")]
107    limit_offset: Option<Value>,
108    /// # of result tuples to return
109    #[serde(rename = "limitCount")]
110    limit_count: Option<Value>,
111    /// FOR UPDATE (list of LockingClause's)
112    #[serde(rename = "lockingClause")]
113    locking_clause: Option<Value>,
114    /// WITH clause
115    #[serde(rename = "withClause")]
116    with_clause: Option<Value>,
117
118    //
119    // These fields are used only in upper-level SelectStmts.
120    //
121    /// type of set op
122    #[serde(default)]
123    pub op: SetOperation,
124    /// ALL specified?
125    #[serde(default)]
126    pub all: bool,
127    /// left child
128    pub larg: Option<Box<SelectChild>>,
129    /// right child
130    pub rarg: Option<Box<SelectChild>>,
131}
132
133/// Sort ordering options for ORDER BY and CREATE INDEX
134#[derive(Serialize_repr, Deserialize_repr, PartialEq, Debug)]
135#[repr(u8)]
136pub enum SortByDir {
137    Default,
138    Asc,
139    Desc,
140    /// not allowed in CREATE INDEX ...
141    Using,
142}
143
144impl Default for SortByDir {
145    fn default() -> Self {
146        Self::Default
147    }
148}
149
150#[derive(Serialize_repr, Deserialize_repr, PartialEq, Debug)]
151#[repr(u8)]
152pub enum SortByNulls {
153    Default,
154    First,
155    Last,
156}
157
158impl Default for SortByNulls {
159    fn default() -> Self {
160        Self::Default
161    }
162}
163
164#[derive(Debug, Deserialize, Serialize)]
165pub struct IndexElem {
166    /// name of attribute to index, or NULL
167    name: String,
168    /// expression to index, or NULL
169    expr: Option<String>,
170    /// name for index column; NULL = default
171    indexcolname: Option<String>,
172    /// name of collation; NIL = default
173    collation: Option<Value>,
174    /// name of desired opclass; NIL = default
175    #[serde(default)]
176    opclass: Vec<Value>,
177    /// ASC/DESC/default
178    #[serde(default)]
179    ordering: SortByDir,
180    /// FIRST/LAST/default
181    #[serde(default)]
182    nulls_ordering: SortByNulls,
183}
184
185#[derive(Debug, Deserialize, Serialize)]
186pub enum IndexParams {
187    IndexElem(IndexElem),
188}
189
190#[derive(Debug, Deserialize, Serialize)]
191pub struct RangeVar {
192    /// the catalog (database) name, or NULL
193    pub catalogname: Option<String>,
194    /// the schema name, or NULL
195    pub schemaname: Option<String>,
196    /// the relation/sequence name
197    pub relname: String,
198    /// expand rel by inheritance? recursively act on children?
199    pub inh: bool,
200    /// see RELPERSISTENCE_* in pg_class.h
201    pub relpersistence: String,
202    /// table alias & optional column aliases
203    pub alias: Option<Value>,
204    /// token location, or -1 if unknown
205    pub location: i32,
206}
207
208#[derive(Debug, Deserialize, Serialize)]
209pub enum RelationKind {
210    RangeVar(RangeVar),
211}
212
213#[derive(Debug, Deserialize, Serialize)]
214pub struct IndexStmt {
215    /// name of access method (eg. btree)
216    #[serde(rename = "accessMethod")]
217    pub access_method: String,
218    /// name of new index, or NULL for default
219    pub idxname: String,
220    #[serde(rename = "indexParams")]
221    pub index_params: Vec<IndexParams>,
222    /// relation to build index on
223    pub relation: RelationKind,
224    #[serde(default)]
225    pub concurrent: bool,
226    /// is index unique
227    #[serde(default)]
228    pub unique: bool,
229    /// is index a primary key?
230    #[serde(default)]
231    pub primary: bool,
232    /// is it for a pkey/unique constraint?
233    #[serde(default)]
234    pub isconstraint: bool,
235    /// is the constraint DEFERRABLE?
236    #[serde(default)]
237    pub deferrable: bool,
238    /// is the constraint INITIALLY DEFERRED?
239    #[serde(default)]
240    pub initdeferred: bool,
241    /// true when transformIndexStmt is finished
242    #[serde(default)]
243    pub transformed: bool,
244    /// should this be a concurrent index build?
245    /// just do nothing if index already exists?
246    #[serde(default)]
247    pub if_not_exists: bool,
248    /// tablespace, or NULL for default
249    #[serde(rename = "tableSpace")]
250    pub table_space: Option<String>,
251}
252
253/// When a command can act on several kinds of objects with only one
254/// parse structure required, use these constants to designate the
255/// object type.  Note that commands typically don't support all the types.
256#[derive(Serialize_repr, Deserialize_repr, PartialEq, Debug)]
257#[repr(u8)]
258pub enum ObjectType {
259    AccessMethod,
260    Aggregate,
261    Amop,
262    Amproc,
263    /// type's attribute, when distinct from column
264    Attribute,
265    Cast,
266    Column,
267    Collation,
268    Conversion,
269    Database,
270    Default,
271    Defacl,
272    Domain,
273    Domconstraint,
274    EventTrigger,
275    Extension,
276    Fdw,
277    ForeignServer,
278    ForeignTable,
279    Function,
280    Index,
281    Language,
282    Largeobject,
283    Matview,
284    Opclass,
285    Operator,
286    Opfamily,
287    Policy,
288    Publication,
289    PublicationRel,
290    Role,
291    Rule,
292    Schema,
293    Sequence,
294    Subscription,
295    StatisticExt,
296    TabConstraint,
297    Table,
298    Tablespace,
299    Transform,
300    Trigger,
301    TsConfiguration,
302    TsDictionary,
303    TsParser,
304    TsTemplate,
305    Type,
306    UserMapping,
307    View,
308}
309
310// List	   *options;		/* WITH clause options: a list of DefElem */
311// Node	   *whereClause;	/* qualification (partial-index predicate) */
312// List	   *excludeOpNames; /* exclusion operator names, or NIL if none */
313// char	   *idxcomment;		/* comment to apply to index, or NULL */
314// Oid			indexOid;		/* OID of an existing index, if any */
315// Oid			oldNode;		/* relfilenode of existing storage, if any */
316#[derive(Debug, Deserialize, Serialize)]
317pub enum AlterTableCmds {
318    AlterTableCmd(AlterTableCmd),
319}
320
321#[derive(Debug, Deserialize, Serialize)]
322pub struct AlterTableStmt {
323    pub cmds: Vec<AlterTableCmds>,
324    pub relation: RelationKind,
325    pub relkind: ObjectType,
326    #[serde(default)]
327    pub missing_ok: bool,
328}
329
330#[derive(Serialize_repr, Deserialize_repr, PartialEq, Debug)]
331#[repr(u8)]
332pub enum DropBehavior {
333    /// drop fails if any dependent objects
334    Restrict,
335    /// remove dependent objects too
336    DropCascade,
337}
338impl Default for DropBehavior {
339    fn default() -> Self {
340        Self::Restrict
341    }
342}
343
344#[derive(Serialize_repr, Deserialize_repr, PartialEq, Debug)]
345#[repr(u8)]
346pub enum AlterTableType {
347    /// add column
348    AddColumn,
349    /// internal to commands/tablecmds.c
350    AddColumnRecurse,
351    /// implicitly via CREATE OR REPLACE VIEW
352    AddColumnToView,
353    /// alter column default
354    ColumnDefault,
355    /// alter column drop not null
356    DropNotNull,
357    /// alter column set not null
358    SetNotNull,
359    /// alter column set statistics
360    SetStatistics,
361    /// alter column set ( options )
362    SetOptions,
363    /// alter column reset ( options )
364    ResetOptions,
365    /// alter column set storage
366    SetStorage,
367    /// drop column
368    DropColumn,
369    /// internal to commands/tablecmds.c
370    DropColumnRecurse,
371    /// add index
372    AddIndex,
373    /// internal to commands/tablecmds.c
374    ReAddIndex,
375    /// add constraint
376    AddConstraint,
377    /// internal to commands/tablecmds.c
378    AddConstraintRecurse,
379    /// internal to commands/tablecmds.c
380    ReAddConstraint,
381    /// alter constraint
382    AlterConstraint,
383    /// validate constraint
384    ValidateConstraint,
385    /// internal to commands/tablecmds.c
386    ValidateConstraintRecurse,
387    /// pre-processed add constraint (local in parser/parse_utilcmd.c)
388    ProcessedConstraint,
389    /// add constraint using existing index
390    AddIndexConstraint,
391    /// drop constraint
392    DropConstraint,
393    /// internal to commands/tablecmds.c
394    DropConstraintRecurse,
395    /// internal to commands/tablecmds.c
396    ReAddComment,
397    /// alter column type
398    AlterColumnType,
399    /// alter column OPTIONS (...)
400    AlterColumnGenericOptions,
401    /// change owner
402    ChangeOwner,
403    /// CLUSTER ON
404    ClusterOn,
405    /// SET WITHOUT CLUSTER
406    DropCluster,
407    /// SET LOGGED
408    SetLogged,
409    /// SET UNLOGGED
410    SetUnLogged,
411    /// SET WITH OIDS
412    AddOids,
413    /// internal to commands/tablecmds.c
414    AddOidsRecurse,
415    /// SET WITHOUT OIDS
416    DropOids,
417    /// SET TABLESPACE
418    SetTableSpace,
419    /// SET (...) -- AM specific parameters
420    SetRelOptions,
421    /// RESET (...) -- AM specific parameters
422    ResetRelOptions,
423    /// replace reloption list in its entirety
424    ReplaceRelOptions,
425    /// ENABLE TRIGGER name
426    EnableTrig,
427    /// ENABLE ALWAYS TRIGGER name
428    EnableAlwaysTrig,
429    /// ENABLE REPLICA TRIGGER name
430    EnableReplicaTrig,
431    /// DISABLE TRIGGER name
432    DisableTrig,
433    /// ENABLE TRIGGER ALL
434    EnableTrigAll,
435    /// DISABLE TRIGGER ALL
436    DisableTrigAll,
437    /// ENABLE TRIGGER USER
438    EnableTrigUser,
439    /// DISABLE TRIGGER USER
440    DisableTrigUser,
441    /// ENABLE RULE name
442    EnableRule,
443    /// ENABLE ALWAYS RULE name
444    EnableAlwaysRule,
445    /// ENABLE REPLICA RULE name
446    EnableReplicaRule,
447    /// DISABLE RULE name
448    DisableRule,
449    /// INHERIT parent
450    AddInherit,
451    /// NO INHERIT parent
452    DropInherit,
453    /// OF <type_name>
454    AddOf,
455    /// NOT OF
456    DropOf,
457    /// REPLICA IDENTITY
458    ReplicaIdentity,
459    /// ENABLE ROW SECURITY
460    EnableRowSecurity,
461    /// DISABLE ROW SECURITY
462    DisableRowSecurity,
463    /// FORCE ROW SECURITY
464    ForceRowSecurity,
465    /// NO FORCE ROW SECURITY
466    NoForceRowSecurity,
467    /// OPTIONS (...)
468    GenericOptions,
469    /// ATTACH PARTITION
470    AttachPartition,
471    /// DETACH PARTITION
472    DetachPartition,
473    /// ADD IDENTITY
474    AddIdentity,
475    /// SET identity column options
476    SetIdentity,
477    /// DROP IDENTITY
478    DropIdentity,
479}
480
481#[derive(Debug, Deserialize, Serialize)]
482pub enum ColumnDefConstraint {
483    Constraint(Constraint),
484}
485
486#[derive(Debug, Deserialize, Serialize)]
487pub struct PGString {
488    pub str: String,
489}
490
491#[derive(Debug, Deserialize, Serialize)]
492pub enum QualifiedName {
493    String(PGString),
494}
495
496///
497/// TypeName - specifies a type in definitions
498///
499/// For TypeName structures generated internally, it is often easier to
500/// specify the type by OID than by name.  If "names" is NIL then the
501/// actual type OID is given by typeOid, otherwise typeOid is unused.
502/// Similarly, if "typmods" is NIL then the actual typmod is expected to
503/// be prespecified in typemod, otherwise typemod is unused.
504///
505/// If pct_type is true, then names is actually a field name and we look up
506/// the type of that field.  Otherwise (the normal case), names is a type
507/// name possibly qualified with schema and database name.
508///
509#[derive(Debug, Deserialize, Serialize)]
510pub struct TypeName {
511    /// qualified name (list of Value strings)
512    #[serde(default)]
513    pub names: Vec<QualifiedName>,
514    /// type identified by OID
515    #[serde(rename = "typeOid")]
516    pub type_oid: Option<Value>,
517    /// is a set?
518    #[serde(default)]
519    pub setof: bool,
520    /// %TYPE specified?
521    #[serde(default)]
522    pub pct_type: bool,
523    /// type modifier expression(s)
524    #[serde(default)]
525    pub typmods: Vec<Value>,
526    /// prespecified type modifier
527    pub typemod: i32,
528    #[serde(rename = "arrayBounds", default)]
529    pub array_bounds: Vec<Value>,
530    /// token location, or -1 if unknown
531    pub location: i32,
532}
533
534#[derive(Debug, Deserialize, Serialize)]
535pub enum ColumnDefTypeName {
536    TypeName(TypeName),
537}
538
539#[derive(Debug, Deserialize, Serialize)]
540pub struct ColumnDef {
541    // int			inhcount;		/* number of times column is inherited */
542    // bool		is_not_null;	/* NOT NULL constraint specified? */
543    // bool		is_from_type;	/* column definition came from table type */
544    // bool		is_from_parent; /* column def came from partition parent */
545    // char		storage;		/* attstorage setting, or 0 for default */
546    /// default value (untransformed parse tree)
547    // raw_default: Value,
548    // Node	   *cooked_default; /* default value (transformed expr tree) */
549    // char		identity;		/* attidentity setting */
550    // RangeVar   *identitySequence; /* to store identity sequence name for ALTER
551    // 							   * TABLE ... ADD COLUMN */
552    // CollateClause *collClause;	/* untransformed COLLATE spec, if any */
553    // Oid			collOid;		/* collation OID (InvalidOid if not set) */
554    // List	   *fdwoptions;		/* per-column FDW options */
555    pub colname: Option<String>,
556    #[serde(rename = "typeName")]
557    pub type_name: ColumnDefTypeName,
558    #[serde(default)]
559    pub constraints: Vec<ColumnDefConstraint>,
560    /// column has local (non-inherited) def'n
561    #[serde(default)]
562    pub is_local: bool,
563    pub location: i32,
564}
565
566#[derive(Debug, Deserialize, Serialize)]
567pub enum AlterTableDef {
568    Constraint(Constraint),
569    ColumnDef(ColumnDef),
570    #[serde(rename = "A_Const")]
571    Constant(Value),
572    ReplicaIdentityStmt(Value),
573}
574
575#[derive(Debug, Deserialize, Serialize)]
576pub struct AlterTableCmd {
577    /// Type of table alteration to apply
578    pub subtype: AlterTableType,
579    /// column, constraint, or trigger to act on, or tablespace
580    pub name: Option<String>,
581    /// definition of new column, index, constraint, or parent table
582    pub def: Option<AlterTableDef>,
583    #[serde(default)]
584    pub behavior: DropBehavior,
585    // RoleSpec   *newowner;
586    /// skip error if missing?
587    #[serde(default)]
588    pub missing_ok: bool,
589}
590
591#[derive(Serialize_repr, Deserialize_repr, PartialEq, Debug)]
592#[repr(u8)]
593pub enum ConstrType {
594    /// not standard SQL, but a lot of people expect it
595    Null,
596    NotNull,
597    Default,
598    Identity,
599    Check,
600    Primary,
601    Unique,
602    Exclusion,
603    Foreign,
604    /// attributes for previous constraint node
605    AttrDeferrable,
606    AttrNotDeferrable,
607    AttrDeferred,
608    AttrImmediate,
609}
610
611#[derive(Debug, Deserialize, Serialize)]
612pub struct Constraint {
613    pub contype: ConstrType,
614
615    /* Fields used for most/all constraint types: */
616    // char	   *conname;		/* Constraint name, or NULL if unnamed */
617    // bool		deferrable;		/* DEFERRABLE? */
618    // bool		initdeferred;	/* INITIALLY DEFERRED? */
619    /// token location, or -1 if unknown
620    pub location: i32,
621
622    /* Fields used for constraints with expressions (CHECK and DEFAULT): */
623    // bool		is_no_inherit;	/* is constraint non-inheritable? */
624    /// expr, as untransformed parse tree
625    pub raw_expr: Option<Value>,
626    // char	   *cooked_expr;	/* expr, as nodeToString representation */
627    // char		generated_when;
628
629    // Fields used for unique constraints (UNIQUE and PRIMARY KEY): */
630    /// String nodes naming referenced column(s)
631    pub keys: Option<Value>,
632
633    /* Fields used for EXCLUSION constraints: */
634    // List	   *exclusions;		/* list of (IndexElem, operator name) pairs */
635
636    /* Fields used for index constraints (UNIQUE, PRIMARY KEY, EXCLUSION): */
637    // List	   *options;		/* options from WITH clause */
638    /// existing index to use; otherwise NULL
639    pub indexname: Option<String>,
640    // char	   *indexspace;		/* index tablespace; NULL for default */
641    /* These could be, but currently are not, used for UNIQUE/PKEY: */
642    // char	   *access_method;	/* index access method; NULL for default */
643    // Node	   *where_clause;	/* partial index predicate */
644
645    /* Fields used for FOREIGN KEY constraints: */
646    // RangeVar   *pktable;		/* Primary key table */
647    // List	   *fk_attrs;		/* Attributes of foreign key */
648    // List	   *pk_attrs;		/* Corresponding attrs in PK table */
649    // char		fk_matchtype;	/* FULL, PARTIAL, SIMPLE */
650    // char		fk_upd_action;	/* ON UPDATE action */
651    // char		fk_del_action;	/* ON DELETE action */
652    // List	   *old_conpfeqop;	/* pg_constraint.conpfeqop of my former self */
653    // Oid			old_pktable_oid;	/* pg_constraint.confrelid of my former
654    /// skip validation of existing rows?
655    #[serde(default)]
656    pub skip_validation: bool,
657    /// mark the new constraint as valid?
658    #[serde(default)]
659    pub initially_valid: bool,
660}
661
662#[derive(Debug, Deserialize, Serialize)]
663pub struct RenameStmt {
664    // Node	   *object;			/* in case it's some other object */
665    pub newname: String,
666    pub behavior: DropBehavior,
667    // in case it's a table
668    pub relation: Option<RelationKind>,
669    #[serde(rename = "relationType")]
670    pub relation_type: ObjectType,
671    #[serde(rename = "renameType")]
672    pub rename_type: ObjectType,
673    /// name of contained object (column, rule, trigger, etc)
674    pub subname: Option<String>,
675    // bool		missing_ok;		/* skip error if missing? */
676}
677
678#[derive(Debug, Deserialize, Serialize)]
679pub enum TableElt {
680    ColumnDef(ColumnDef),
681}
682
683/// What to do at commit time for temporary relations
684#[derive(Serialize_repr, Deserialize_repr, PartialEq, Debug)]
685#[repr(u8)]
686pub enum OnCommitAction {
687    /// No ON COMMIT clause (do nothing)
688    Noop,
689    /// ON COMMIT PRESERVE ROWS (do nothing)
690    PreserveRows,
691    /// ON COMMIT DELETE ROWS
692    DeleteRows,
693    /// ON COMMIT DROP
694    Drop,
695}
696
697#[derive(Debug, Deserialize, Serialize)]
698pub struct CreateStmt {
699    /// relation to create
700    pub relation: RelationKind,
701    /// column definitions (list of ColumnDef)
702    #[serde(rename = "tableElts")]
703    pub table_elts: Vec<TableElt>,
704    /// relations to inherit from (list of inhRelation)
705    #[serde(rename = "inhRelations")]
706    #[serde(default)]
707    pub inh_relations: Vec<Value>,
708    /// FOR VALUES clause
709    pub partbound: Option<Value>,
710    /// PARTITION BY clause
711    pub partspec: Option<Value>,
712    /// OF typename
713    #[serde(rename = "ofTypename")]
714    pub of_typename: Option<Value>,
715    /// constraints (list of Constraint nodes)
716    #[serde(default)]
717    pub constraints: Vec<Constraint>,
718    /// options from WITH clause
719    #[serde(default)]
720    pub options: Vec<Value>,
721    /// what do we do at COMMIT?
722    pub oncommit: OnCommitAction,
723    /// table space to use, or NULL
724    pub tablespacename: Option<String>,
725    /// just do nothing if it already exists?
726    #[serde(default)]
727    pub if_not_exists: bool,
728}
729
730#[derive(Debug, Deserialize, Serialize)]
731pub enum RootStmt {
732    RawStmt(RawStmt),
733}
734
735/// case for each node type found in Postgres' parsenodes.h
736/// https://github.com/lfittl/libpg_query/blob/6b1c3a582d38701593c5cadd260445737b9f7043/src/postgres/include/nodes/parsenodes.h
737#[allow(clippy::large_enum_variant)]
738#[derive(Debug, Deserialize, Serialize)]
739pub enum Stmt {
740    TransactionStmt(TransactionStmt),
741    SelectStmt(SelectStmt),
742    IndexStmt(IndexStmt),
743    AlterTableStmt(AlterTableStmt),
744    RenameStmt(RenameStmt),
745    CreateStmt(CreateStmt),
746    InsertStmt(Value),
747    UpdateStmt(Value),
748    DeleteStmt(Value),
749    CreateSchemaStmt(Value),
750    AlterDomainStmt(Value),
751    GrantStmt(Value),
752    GrantRoleStmt(Value),
753    AlterDefaultPrivilegesStmt(Value),
754    CopyStmt(Value),
755    VariableSetStmt(Value),
756    VariableShowStmt(Value),
757    CreateTableSpaceStmt(Value),
758    DropTableSpaceStmt(Value),
759    CreateExtensionStmt(Value),
760    AlterExtensionStmt(Value),
761    DropStmt(Value),
762    AlterObjectSchemaStmt(Value),
763    AlterExtensionContentsStmt(Value),
764    CreateFdwStmt(Value),
765    AlterFdwStmt(Value),
766    CreateForeignServerStmt(Value),
767    AlterForeignServerStmt(Value),
768    CreateForeignTableStmt(Value),
769    CreateUserMappingStmt(Value),
770    AlterUserMappingStmt(Value),
771    DropUserMappingStmt(Value),
772    ImportForeignSchemaStmt(Value),
773    CreatePolicyStmt(Value),
774    AlterPolicyStmt(Value),
775    CreateAmStmt(Value),
776    CreateTrigStmt(Value),
777    CreateEventTrigStmt(Value),
778    AlterEventTrigStmt(Value),
779    CreateFunctionStmt(Value),
780    AlterFunctionStmt(Value),
781    CreatePLangStmt(Value),
782    CreateRoleStmt(Value),
783    AlterRoleStmt(Value),
784    AlterRoleSetStmt(Value),
785    DropRoleStmt(Value),
786    CreateSeqStmt(Value),
787    AlterSeqStmt(Value),
788    DefineStmt(Value),
789    CreateDomainStmt(Value),
790    CreateOpClassStmt(Value),
791    CreateOpFamilyStmt(Value),
792    AlterOpFamilyStmt(Value),
793    TruncateStmt(Value),
794    CommentStmt(Value),
795    SecLabelStmt(Value),
796    DeclareCursorStmt(Value),
797    ClosePortalStmt(Value),
798    FetchStmt(Value),
799    CreateStatsStmt(Value),
800    ExplainStmt(Value),
801    AlterOwnerStmt(Value),
802    DoStmt(Value),
803    AlterObjectDependsStmt(Value),
804    AlterOperatorStmt(Value),
805    RuleStmt(Value),
806    NotifyStmt(Value),
807    ListenStmt(Value),
808    UnlistenStmt(Value),
809    CompositeTypeStmt(Value),
810    CreateEnumStmt(Value),
811    CreateRangeStmt(Value),
812    AlterEnumStmt(Value),
813    ViewStmt(Value),
814    LoadStmt(Value),
815    CreatedbStmt(Value),
816    AlterDatabaseStmt(Value),
817    AlterDatabaseSetStmt(Value),
818    DropdbStmt(Value),
819    AlterSystemStmt(Value),
820    ClusterStmt(Value),
821    VacuumStmt(Value),
822    CreateTableAsStmt(Value),
823    RefreshMatViewStmt(Value),
824    CheckPointStmt(Value),
825    DiscardStmt(Value),
826    LockStmt(Value),
827    ConstraintsSetStmt(Value),
828    ReindexStmt(Value),
829    CreateConversionStmt(Value),
830    CreateCastStmt(Value),
831    CreateTransformStmt(Value),
832    PrepareStmt(Value),
833    ExecuteStmt(Value),
834    DeallocateStmt(Value),
835    DropOwnedStmt(Value),
836    ReassignOwnedStmt(Value),
837    AlterTSDictionaryStmt(Value),
838    AlterTSConfigurationStmt(Value),
839    CreatePublicationStmt(Value),
840    AlterPublicationStmt(Value),
841    CreateSubscriptionStmt(Value),
842    AlterSubscriptionStmt(Value),
843    DropSubscriptionStmt(Value),
844}