File tree 2 files changed +12
-0
lines changed
crates/pgt_statement_splitter/src
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,14 @@ mod tests {
105
105
. expect_statements ( vec ! [ "select 1 from contact" , "select 1" ] ) ;
106
106
}
107
107
108
+ #[ test]
109
+ fn grant ( ) {
110
+ Tester :: from ( "GRANT SELECT ON TABLE \" public\" .\" my_table\" TO \" my_role\" ;" )
111
+ . expect_statements ( vec ! [
112
+ "GRANT SELECT ON TABLE \" public\" .\" my_table\" TO \" my_role\" ;" ,
113
+ ] ) ;
114
+ }
115
+
108
116
#[ test]
109
117
fn double_newlines ( ) {
110
118
Tester :: from ( "select 1 from contact\n \n select 1\n \n select 3" ) . expect_statements ( vec ! [
Original file line number Diff line number Diff line change @@ -205,6 +205,8 @@ pub(crate) fn unknown(p: &mut Parser, exclude: &[SyntaxKind]) {
205
205
SyntaxKind :: All ,
206
206
// for UNION ... EXCEPT
207
207
SyntaxKind :: Except ,
208
+ // for grant
209
+ SyntaxKind :: Grant ,
208
210
]
209
211
. iter ( )
210
212
. all ( |x| Some ( x) != prev. as_ref ( ) )
@@ -230,6 +232,8 @@ pub(crate) fn unknown(p: &mut Parser, exclude: &[SyntaxKind]) {
230
232
SyntaxKind :: Also ,
231
233
// for create rule
232
234
SyntaxKind :: Instead ,
235
+ // for grant
236
+ SyntaxKind :: Grant ,
233
237
]
234
238
. iter ( )
235
239
. all ( |x| Some ( x) != prev. as_ref ( ) )
You can’t perform that action at this time.
0 commit comments