File tree 3 files changed +32
-0
lines changed
3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -2025,6 +2025,10 @@ impl Parser {
2025
2025
// ----- DDL -----
2026
2026
fn parse_create_schema_statement ( & mut self , semicolon : bool ) -> BQ2CSTResult < Node > {
2027
2027
let mut create = self . construct_node ( NodeType :: CreateSchemaStatement ) ?;
2028
+ if self . get_token ( 1 ) ?. is ( "EXTERNAL" ) {
2029
+ self . next_token ( ) ?; // -> EXTERNAL
2030
+ create. push_node ( "external" , self . construct_node ( NodeType :: Keyword ) ?) ;
2031
+ }
2028
2032
self . next_token ( ) ?; // -> SCHEMA
2029
2033
create. push_node ( "what" , self . construct_node ( NodeType :: Keyword ) ?) ;
2030
2034
if self . get_token ( 1 ) ?. is ( "IF" ) {
@@ -2047,6 +2051,10 @@ impl Parser {
2047
2051
default. push_node ( "next_keyword" , collate) ;
2048
2052
create. push_node ( "default_collate" , default) ;
2049
2053
}
2054
+ if self . get_token ( 1 ) ?. is ( "WITH" ) && self . get_token ( 2 ) ?. is ( "CONNECTION" ) {
2055
+ self . next_token ( ) ?; // -> WITH
2056
+ create. push_node ( "with_connection" , self . parse_with_connection_clause ( ) ?) ;
2057
+ }
2050
2058
if self . get_token ( 1 ) ?. is ( "OPTIONS" ) {
2051
2059
self . next_token ( ) ?; // OPTIONS
2052
2060
create. push_node ( "options" , self . parse_keyword_with_grouped_exprs ( false ) ?) ;
Original file line number Diff line number Diff line change @@ -71,6 +71,28 @@ ident:
71
71
self: dataset_name (Identifier)
72
72
what:
73
73
self: SCHEMA (Keyword)
74
+ " ,
75
+ 0 ,
76
+ ) ) ,
77
+ Box :: new( SuccessTestCase :: new(
78
+ "\
79
+ CREATE EXTERNAL SCHEMA dataset_name
80
+ WITH CONNECTION connection_name
81
+ " ,
82
+ "\
83
+ self: CREATE (CreateSchemaStatement)
84
+ external:
85
+ self: EXTERNAL (Keyword)
86
+ ident:
87
+ self: dataset_name (Identifier)
88
+ what:
89
+ self: SCHEMA (Keyword)
90
+ with_connection:
91
+ self: WITH (KeywordSequence)
92
+ next_keyword:
93
+ self: CONNECTION (KeywordWithExpr)
94
+ expr:
95
+ self: connection_name (Identifier)
74
96
" ,
75
97
0 ,
76
98
) ) ,
Original file line number Diff line number Diff line change @@ -649,10 +649,12 @@ export type CreateRowAccessPolicyStatement = XXXStatement & {
649
649
export type CreateSchemaStatement = XXXStatement & {
650
650
node_type: "CreateSchemaStatement";
651
651
children: {
652
+ external?: NodeChild;
652
653
what: NodeChild;
653
654
if_not_exists?: NodeVecChild;
654
655
ident: NodeChild;
655
656
default_collate: NodeChild;
657
+ with_connection?: NodeChild;
656
658
options?: NodeChild;
657
659
};
658
660
};
You can’t perform that action at this time.
0 commit comments