@@ -3846,6 +3846,14 @@ pub enum Statement {
3846
3846
///
3847
3847
/// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_schema_statement)
3848
3848
default_collate_spec : Option < Expr > ,
3849
+ /// Clones a schema
3850
+ ///
3851
+ /// ```sql
3852
+ /// CREATE SCHEMA myschema CLONE otherschema
3853
+ /// ```
3854
+ ///
3855
+ /// [Snowflake](https://docs.snowflake.com/en/sql-reference/sql/create-clone#databases-schemas)
3856
+ clone : Option < ObjectName > ,
3849
3857
} ,
3850
3858
/// ```sql
3851
3859
/// CREATE DATABASE
@@ -3855,6 +3863,14 @@ pub enum Statement {
3855
3863
if_not_exists : bool ,
3856
3864
location : Option < String > ,
3857
3865
managed_location : Option < String > ,
3866
+ /// Clones a database
3867
+ ///
3868
+ /// ```sql
3869
+ /// CREATE DATABASE mydb CLONE otherdb
3870
+ /// ```
3871
+ ///
3872
+ /// [Snowflake](https://docs.snowflake.com/en/sql-reference/sql/create-clone#databases-schemas)
3873
+ clone : Option < ObjectName > ,
3858
3874
} ,
3859
3875
/// ```sql
3860
3876
/// CREATE FUNCTION
@@ -4797,6 +4813,7 @@ impl fmt::Display for Statement {
4797
4813
if_not_exists,
4798
4814
location,
4799
4815
managed_location,
4816
+ clone,
4800
4817
} => {
4801
4818
write ! ( f, "CREATE DATABASE" ) ?;
4802
4819
if * if_not_exists {
@@ -4809,6 +4826,9 @@ impl fmt::Display for Statement {
4809
4826
if let Some ( ml) = managed_location {
4810
4827
write ! ( f, " MANAGEDLOCATION '{ml}'" ) ?;
4811
4828
}
4829
+ if let Some ( clone) = clone {
4830
+ write ! ( f, " CLONE {clone}" ) ?;
4831
+ }
4812
4832
Ok ( ( ) )
4813
4833
}
4814
4834
Statement :: CreateFunction ( create_function) => create_function. fmt ( f) ,
@@ -5730,6 +5750,7 @@ impl fmt::Display for Statement {
5730
5750
with,
5731
5751
options,
5732
5752
default_collate_spec,
5753
+ clone,
5733
5754
} => {
5734
5755
write ! (
5735
5756
f,
@@ -5750,6 +5771,9 @@ impl fmt::Display for Statement {
5750
5771
write ! ( f, " OPTIONS({})" , display_comma_separated( options) ) ?;
5751
5772
}
5752
5773
5774
+ if let Some ( clone) = clone {
5775
+ write ! ( f, " CLONE {clone}" ) ?;
5776
+ }
5753
5777
Ok ( ( ) )
5754
5778
}
5755
5779
Statement :: Assert { condition, message } => {
0 commit comments