File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
crates/pgt_statement_splitter/src Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,30 @@ mod tests {
133133 }
134134 }
135135
136+ #[ test]
137+ fn begin_atomic ( ) {
138+ Tester :: from (
139+ "CREATE OR REPLACE FUNCTION public.test_fn(some_in TEXT)
140+ RETURNS TEXT
141+ LANGUAGE sql
142+ IMMUTABLE
143+ STRICT
144+ BEGIN ATOMIC
145+ SELECT $1 || 'foo';
146+ END;" ,
147+ )
148+ . expect_statements ( vec ! [
149+ "CREATE OR REPLACE FUNCTION public.test_fn(some_in TEXT)
150+ RETURNS TEXT
151+ LANGUAGE sql
152+ IMMUTABLE
153+ STRICT
154+ BEGIN ATOMIC
155+ SELECT $1 || 'foo';
156+ END;" ,
157+ ] ) ;
158+ }
159+
136160 #[ test]
137161 fn ts_with_timezone ( ) {
138162 Tester :: from ( "alter table foo add column bar timestamp with time zone;" ) . expect_statements (
Original file line number Diff line number Diff line change @@ -188,6 +188,8 @@ pub(crate) fn unknown(p: &mut Splitter, exclude: &[SyntaxKind]) {
188188 // for revoke
189189 SyntaxKind :: REVOKE_KW ,
190190 SyntaxKind :: COMMA ,
191+ // for BEGIN ATOMIC
192+ SyntaxKind :: ATOMIC_KW ,
191193 ]
192194 . iter ( )
193195 . all ( |x| Some ( x) != prev. as_ref ( ) )
You can’t perform that action at this time.
0 commit comments