File tree Expand file tree Collapse file tree 4 files changed +9
-3
lines changed
pglt_analyser/src/lint/safety
pglt_statement_splitter/src Expand file tree Collapse file tree 4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ declare_lint_rule! {
1212 ///
1313 /// ### Invalid
1414 ///
15- /// ```sql,ignore
15+ /// ```sql,expect_diagnostic
1616 /// alter table test drop column id;
1717 /// ```
1818 ///
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ declare_lint_rule! {
1212 ///
1313 /// ### Invalid
1414 ///
15- /// ```sql,ignore
15+ /// ```sql,expect_diagnostic
1616 /// alter table users alter column email drop not null;
1717 /// ```
1818 pub BanDropNotNull {
Original file line number Diff line number Diff line change @@ -104,6 +104,12 @@ mod tests {
104104 ] ) ;
105105 }
106106
107+ #[ test]
108+ fn alter_column ( ) {
109+ Tester :: from ( "alter table users alter column email drop not null;" )
110+ . expect_statements ( vec ! [ "alter table users alter column email drop not null;" ] ) ;
111+ }
112+
107113 #[ test]
108114 fn insert_expect_error ( ) {
109115 Tester :: from ( "\n insert select 1\n \n select 3" )
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ pub(crate) fn create(p: &mut Parser) {
1111pub ( crate ) fn alter ( p : & mut Parser ) {
1212 p. expect ( SyntaxKind :: Alter ) ;
1313
14- unknown ( p, & [ ] ) ;
14+ unknown ( p, & [ SyntaxKind :: Alter ] ) ;
1515}
You can’t perform that action at this time.
0 commit comments