File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -536,6 +536,18 @@ fn custom_handlers(node: &Node) -> TokenStream {
536536 tokens. push( TokenProperty :: from( Token :: As ) ) ;
537537 }
538538 } ,
539+ "CreateSchemaStmt" => quote ! {
540+ tokens. push( TokenProperty :: from( Token :: Create ) ) ;
541+ tokens. push( TokenProperty :: from( Token :: Schema ) ) ;
542+ if n. if_not_exists {
543+ tokens. push( TokenProperty :: from( Token :: IfP ) ) ;
544+ tokens. push( TokenProperty :: from( Token :: Not ) ) ;
545+ tokens. push( TokenProperty :: from( Token :: Exists ) ) ;
546+ }
547+ if n. authrole. is_some( ) {
548+ tokens. push( TokenProperty :: from( Token :: Authorization ) ) ;
549+ }
550+ } ,
539551 _ => quote ! { } ,
540552 }
541553}
Original file line number Diff line number Diff line change @@ -107,4 +107,21 @@ mod tests {
107107 ] ,
108108 )
109109 }
110+
111+ #[ test]
112+ fn test_create_schema ( ) {
113+ test_get_node_properties (
114+ "create schema if not exists test authorization joe;" ,
115+ SyntaxKind :: CreateSchemaStmt ,
116+ vec ! [
117+ TokenProperty :: from( SyntaxKind :: Create ) ,
118+ TokenProperty :: from( SyntaxKind :: Schema ) ,
119+ TokenProperty :: from( SyntaxKind :: IfP ) ,
120+ TokenProperty :: from( SyntaxKind :: Not ) ,
121+ TokenProperty :: from( SyntaxKind :: Exists ) ,
122+ TokenProperty :: from( SyntaxKind :: Authorization ) ,
123+ TokenProperty :: from( "test" . to_string( ) ) ,
124+ ] ,
125+ )
126+ }
110127}
You can’t perform that action at this time.
0 commit comments