File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -529,6 +529,18 @@ fn custom_handlers(node: &Node) -> TokenStream {
529
529
"TypeCast" => quote ! {
530
530
tokens. push( TokenProperty :: from( Token :: Typecast ) ) ;
531
531
} ,
532
+ "CreateSchemaStmt" => quote ! {
533
+ tokens. push( TokenProperty :: from( Token :: Create ) ) ;
534
+ tokens. push( TokenProperty :: from( Token :: Schema ) ) ;
535
+ if n. if_not_exists {
536
+ tokens. push( TokenProperty :: from( Token :: IfP ) ) ;
537
+ tokens. push( TokenProperty :: from( Token :: Not ) ) ;
538
+ tokens. push( TokenProperty :: from( Token :: Exists ) ) ;
539
+ }
540
+ if n. authrole. is_some( ) {
541
+ tokens. push( TokenProperty :: from( Token :: Authorization ) ) ;
542
+ }
543
+ } ,
532
544
_ => quote ! { } ,
533
545
}
534
546
}
Original file line number Diff line number Diff line change @@ -91,4 +91,21 @@ mod tests {
91
91
] ,
92
92
)
93
93
}
94
+
95
+ #[ test]
96
+ fn test_create_schema ( ) {
97
+ test_get_node_properties (
98
+ "create schema if not exists test authorization joe;" ,
99
+ SyntaxKind :: CreateSchemaStmt ,
100
+ vec ! [
101
+ TokenProperty :: from( SyntaxKind :: Create ) ,
102
+ TokenProperty :: from( SyntaxKind :: Schema ) ,
103
+ TokenProperty :: from( SyntaxKind :: IfP ) ,
104
+ TokenProperty :: from( SyntaxKind :: Not ) ,
105
+ TokenProperty :: from( SyntaxKind :: Exists ) ,
106
+ TokenProperty :: from( SyntaxKind :: Authorization ) ,
107
+ TokenProperty :: from( "test" . to_string( ) ) ,
108
+ ] ,
109
+ )
110
+ }
94
111
}
You can’t perform that action at this time.
0 commit comments