@@ -30,11 +30,11 @@ use sqlparser_derive::{Visit, VisitMut};
3030
3131use crate :: ast:: value:: escape_single_quote_string;
3232use crate :: ast:: {
33- display_comma_separated, display_separated, CatalogSyncNamespaceMode , CommentDef , ContactEntry ,
34- CreateFunctionBody , CreateFunctionUsing , DataType , Expr , FunctionBehavior ,
35- FunctionCalledOnNull , FunctionDeterminismSpecifier , FunctionParallel , Ident ,
36- MySQLColumnPosition , ObjectName , OperateFunctionArg , OrderByExpr , ProjectionSelect ,
37- SequenceOptions , SqlOption , StorageSerializationPolicy , Tag , Value , ValueWithSpan ,
33+ display_comma_separated, display_separated, CommentDef , CreateFunctionBody ,
34+ CreateFunctionUsing , DataType , Expr , FunctionBehavior , FunctionCalledOnNull ,
35+ FunctionDeterminismSpecifier , FunctionParallel , Ident , MySQLColumnPosition , ObjectName ,
36+ OperateFunctionArg , OrderByExpr , ProjectionSelect , SequenceOptions , SqlOption , Tag , Value ,
37+ ValueWithSpan ,
3838} ;
3939use crate :: keywords:: Keyword ;
4040use crate :: tokenizer:: Token ;
@@ -2272,104 +2272,3 @@ impl fmt::Display for CreateConnector {
22722272 Ok ( ( ) )
22732273 }
22742274}
2275-
2276- #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
2277- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
2278- #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
2279- pub struct CreateSnowflakeDatabase {
2280- pub name : ObjectName ,
2281- pub or_replace : bool ,
2282- pub transient : bool ,
2283- pub if_not_exists : bool ,
2284- pub clone : Option < ObjectName > ,
2285- pub data_retention_time_in_days : Option < u64 > ,
2286- pub max_data_extension_time_in_days : Option < u64 > ,
2287- pub external_volume : Option < String > ,
2288- pub catalog : Option < String > ,
2289- pub replace_invalid_characters : Option < bool > ,
2290- pub default_ddl_collation : Option < String > ,
2291- pub storage_serialization_policy : Option < StorageSerializationPolicy > ,
2292- pub comment : Option < String > ,
2293- pub catalog_sync : Option < String > ,
2294- pub catalog_sync_namespace_mode : Option < CatalogSyncNamespaceMode > ,
2295- pub catalog_sync_namespace_flatten_delimiter : Option < String > ,
2296- pub with_tags : Option < Vec < Tag > > ,
2297- pub with_contacts : Option < Vec < ContactEntry > > ,
2298- }
2299-
2300- impl fmt:: Display for CreateSnowflakeDatabase {
2301- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2302- write ! (
2303- f,
2304- "CREATE {or_replace}{transient}DATABASE {if_not_exists}{name}" ,
2305- or_replace = if self . or_replace { "OR REPLACE " } else { "" } ,
2306- transient = if self . transient { "TRANSIENT " } else { "" } ,
2307- if_not_exists = if self . if_not_exists {
2308- "IF NOT EXISTS "
2309- } else {
2310- ""
2311- } ,
2312- name = self . name,
2313- ) ?;
2314-
2315- if let Some ( clone) = & self . clone {
2316- write ! ( f, " CLONE {clone}" ) ?;
2317- }
2318-
2319- if let Some ( value) = self . data_retention_time_in_days {
2320- write ! ( f, " DATA_RETENTION_TIME_IN_DAYS = {value}" ) ?;
2321- }
2322-
2323- if let Some ( value) = self . max_data_extension_time_in_days {
2324- write ! ( f, " MAX_DATA_EXTENSION_TIME_IN_DAYS = {value}" ) ?;
2325- }
2326-
2327- if let Some ( vol) = & self . external_volume {
2328- write ! ( f, " EXTERNAL_VOLUME = '{vol}'" ) ?;
2329- }
2330-
2331- if let Some ( cat) = & self . catalog {
2332- write ! ( f, " CATALOG = '{cat}'" ) ?;
2333- }
2334-
2335- if let Some ( true ) = self . replace_invalid_characters {
2336- write ! ( f, " REPLACE_INVALID_CHARACTERS = TRUE" ) ?;
2337- } else if let Some ( false ) = self . replace_invalid_characters {
2338- write ! ( f, " REPLACE_INVALID_CHARACTERS = FALSE" ) ?;
2339- }
2340-
2341- if let Some ( collation) = & self . default_ddl_collation {
2342- write ! ( f, " DEFAULT_DDL_COLLATION = '{collation}'" ) ?;
2343- }
2344-
2345- if let Some ( policy) = & self . storage_serialization_policy {
2346- write ! ( f, " STORAGE_SERIALIZATION_POLICY = {policy}" ) ?;
2347- }
2348-
2349- if let Some ( comment) = & self . comment {
2350- write ! ( f, " COMMENT = '{comment}'" ) ?;
2351- }
2352-
2353- if let Some ( sync) = & self . catalog_sync {
2354- write ! ( f, " CATALOG_SYNC = '{sync}'" ) ?;
2355- }
2356-
2357- if let Some ( mode) = & self . catalog_sync_namespace_mode {
2358- write ! ( f, " CATALOG_SYNC_NAMESPACE_MODE = {mode}" ) ?;
2359- }
2360-
2361- if let Some ( delim) = & self . catalog_sync_namespace_flatten_delimiter {
2362- write ! ( f, " CATALOG_SYNC_NAMESPACE_FLATTEN_DELIMITER = '{delim}'" ) ?;
2363- }
2364-
2365- if let Some ( tags) = & self . with_tags {
2366- write ! ( f, " WITH TAG ({})" , display_comma_separated( tags) ) ?;
2367- }
2368-
2369- if let Some ( contacts) = & self . with_contacts {
2370- write ! ( f, " WITH CONTACT ({})" , display_comma_separated( contacts) ) ?;
2371- }
2372-
2373- Ok ( ( ) )
2374- }
2375- }
0 commit comments