Skip to content

Commit

Permalink
Change parser to make EdgeTableClause optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Dtenwolde committed Feb 5, 2024
1 parent 3e2ceda commit 82a0598
Show file tree
Hide file tree
Showing 3 changed files with 11,204 additions and 11,172 deletions.
10 changes: 8 additions & 2 deletions third_party/libpg_query/grammar/statements/pgq.y
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,21 @@ EdgeOrRelationship:
RELATIONSHIP
;

EdgeTablesClauseOptional:
EdgeOrRelationship TABLES '(' EdgeTableDefinition EdgeTableDefinitionList ')' { $$ = $5?lappend($5,$4):list_make1($4); }
|
/* EMPTY */ { $$ = NULL; }


CreatePropertyGraphStmt:
CREATE_P PROPERTY GRAPH qualified_name
VertexOrNode TABLES '(' VertexTableDefinition VertexTableDefinitionList ')'
EdgeOrRelationship TABLES '(' EdgeTableDefinition EdgeTableDefinitionList ')'
EdgeTablesClauseOptional
{
PGCreatePropertyGraphStmt *n = makeNode(PGCreatePropertyGraphStmt);
n->name = $4;
n->vertex_tables = $9?lappend($9,$8):list_make1($8);
n->edge_tables = $15?lappend($15,$14):list_make1($14);
n->edge_tables = $11;
$$ = (PGNode *)n;
}
;
Expand Down
1 change: 1 addition & 0 deletions third_party/libpg_query/grammar/types/pgq.yh
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@
%type <list> VertexPattern
%type <node> pgq_expr
%type <str> LabelOptional
%type <list> EdgeTablesClauseOptional
Loading

0 comments on commit 82a0598

Please sign in to comment.