Skip to content

Commit 1535b76

Browse files
fix(splitter): do update in INSERT INTO (#436)
1 parent e24bacd commit 1535b76

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

crates/pgt_statement_splitter/src/parser/common.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ pub(crate) fn unknown(p: &mut Parser, exclude: &[SyntaxKind]) {
248248
// for grant
249249
SyntaxKind::Grant,
250250
SyntaxKind::Ascii44,
251+
// Do update in INSERT stmt
252+
SyntaxKind::Do,
251253
]
252254
.iter()
253255
.all(|x| Some(x) != prev.as_ref())
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
INSERT INTO foo.bar (
2+
pk
3+
) VALUES (
4+
$1
5+
) ON CONFLICT (pk) DO UPDATE SET
6+
date_deleted = DEFAULT,
7+
date_created = DEFAULT;

0 commit comments

Comments
 (0)