Skip to content

Commit

Permalink
fix: pg type generation
Browse files Browse the repository at this point in the history
  • Loading branch information
taozhi8833998 committed May 20, 2024
1 parent 54be8a0 commit a8ea6b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ast/postgresql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ export type rename_stmt = AstStatement<rename_stmt_node>;

export interface set_stmt_node {
type: 'set';
expr: assign_stmt & { keyword?: 'GLOBAL' | 'SESSION' | 'LOCAL' | 'PERSIST' | 'PERSIST_ONLY'; };
keyword?: 'GLOBAL' | 'SESSION' | 'LOCAL' | 'PERSIST' | 'PERSIST_ONLY' | undefined;
expr: assign_stmt_list;
}

export type set_stmt = AstStatement<set_stmt_node>;
Expand Down Expand Up @@ -1791,6 +1792,8 @@ export interface proc_stmt_t { type: 'proc'; stmt: assign_stmt | return_stmt; va

export type proc_stmt = AstStatement<proc_stmt_t>;

export type assign_stmt_list = assign_stmt[];

export type assign_stmt = { type: 'assign'; left: var_decl | without_prefix_var_decl; symbol: ':=' | '='; right: proc_expr; };

export type return_stmt = { type: 'return'; expr: proc_expr; };
Expand Down
3 changes: 2 additions & 1 deletion pegjs/postgresql.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -2272,7 +2272,7 @@ set_stmt
export interface set_stmt_node {
type: 'set';
keyword?: 'GLOBAL' | 'SESSION' | 'LOCAL' | 'PERSIST' | 'PERSIST_ONLY' | undefined;
expr: assign_stmt;
expr: assign_stmt_list;
}
=> AstStatement<set_stmt_node>
*/
Expand Down Expand Up @@ -5261,6 +5261,7 @@ proc_stmt

assign_stmt_list
= head:assign_stmt tail:(__ COMMA __ assign_stmt)* {
// => assign_stmt[]
return createList(head, tail);
}

Expand Down

0 comments on commit a8ea6b9

Please sign in to comment.