Skip to content

Commit 152960d

Browse files
author
zhaoge
committed
feat(postgre): #412 update merge's syntax and with clause syntax
1 parent 7324c27 commit 152960d

File tree

5 files changed

+3721
-3683
lines changed

5 files changed

+3721
-3683
lines changed

Diff for: src/grammar/postgresql/PostgreSqlParser.g4

+4
Original file line numberDiff line numberDiff line change
@@ -1911,11 +1911,13 @@ prep_type_clause
19111911
: OPEN_PAREN typename (COMMA typename)* CLOSE_PAREN
19121912
;
19131913

1914+
// https://www.postgresql.org/docs/17/sql-select.html
19141915
preparablestmt
19151916
: selectstmt
19161917
| insertstmt
19171918
| updatestmt
19181919
| deletestmt
1920+
| mergestmt
19191921
;
19201922

19211923
executestmt
@@ -3558,8 +3560,10 @@ stmt_move
35583560
: KW_MOVE opt_fetch_direction? cursor_variable SEMI
35593561
;
35603562

3563+
// https://www.postgresql.org/docs/17/sql-merge.html
35613564
mergestmt
35623565
: with_clause? KW_MERGE KW_INTO (KW_ONLY)? table_name (STAR)? (KW_AS? colid)? KW_USING data_source KW_ON expression merge_when_clause+
3566+
returning_clause?
35633567
;
35643568

35653569
data_source

Diff for: src/lib/postgresql/PostgreSqlParser.interp

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)