Skip to content

Commit

Permalink
Add parser rules for create or replace pg
Browse files Browse the repository at this point in the history
  • Loading branch information
Dtenwolde committed Mar 8, 2024
1 parent 4b2b616 commit 5e9755a
Show file tree
Hide file tree
Showing 3 changed files with 18,352 additions and 18,293 deletions.
15 changes: 15 additions & 0 deletions third_party/libpg_query/grammar/statements/pgq.y
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,24 @@ CreatePropertyGraphStmt:
n->name = $4;
n->vertex_tables = $9?lappend($9,$8):list_make1($8);
n->edge_tables = $11;
n->onconflict = PG_ERROR_ON_CONFLICT;
$$ = (PGNode *)n;
}
;
|
CREATE_P OR REPLACE PROPERTY GRAPH qualified_name
VertexOrNode TABLES '(' VertexTableDefinition VertexTableDefinitionList ')'
EdgeTablesClauseOptional
{
PGCreatePropertyGraphStmt *n = makeNode(PGCreatePropertyGraphStmt);
n->name = $6;
n->vertex_tables = $11?lappend($11,$10):list_make1($10);
n->edge_tables = $13;
n->onconflict = PG_REPLACE_ON_CONFLICT;
$$ = (PGNode *)n;
}
;


VertexTableDefinitionList:
',' VertexTableDefinition
Expand Down
1 change: 1 addition & 0 deletions third_party/libpg_query/include/nodes/parsenodes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2178,6 +2178,7 @@ typedef struct PGCreatePropertyGraphStmt {
PGRangeVar *name;
PGList *vertex_tables;
PGList *edge_tables;
PGOnCreateConflict onconflict; /* what to do on create conflict */
} PGCreatePropertyGraphStmt;

typedef struct PGPropertyGraphTable {
Expand Down
Loading

0 comments on commit 5e9755a

Please sign in to comment.