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 @@ -536,6 +536,18 @@ fn custom_handlers(node: &Node) -> TokenStream {
536
536
tokens. push( TokenProperty :: from( Token :: As ) ) ;
537
537
}
538
538
} ,
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
+ } ,
539
551
_ => quote ! { } ,
540
552
}
541
553
}
Original file line number Diff line number Diff line change @@ -105,4 +105,21 @@ mod tests {
105
105
] ,
106
106
)
107
107
}
108
+
109
+ #[ test]
110
+ fn test_create_schema ( ) {
111
+ test_get_node_properties (
112
+ "create schema if not exists test authorization joe;" ,
113
+ SyntaxKind :: CreateSchemaStmt ,
114
+ vec ! [
115
+ TokenProperty :: from( SyntaxKind :: Create ) ,
116
+ TokenProperty :: from( SyntaxKind :: Schema ) ,
117
+ TokenProperty :: from( SyntaxKind :: IfP ) ,
118
+ TokenProperty :: from( SyntaxKind :: Not ) ,
119
+ TokenProperty :: from( SyntaxKind :: Exists ) ,
120
+ TokenProperty :: from( SyntaxKind :: Authorization ) ,
121
+ TokenProperty :: from( "test" . to_string( ) ) ,
122
+ ] ,
123
+ )
124
+ }
108
125
}
You can’t perform that action at this time.
0 commit comments