@@ -3875,6 +3875,14 @@ pub enum Statement {
38753875 ///
38763876 /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_schema_statement)
38773877 default_collate_spec : Option < Expr > ,
3878+ /// Clones a schema
3879+ ///
3880+ /// ```sql
3881+ /// CREATE SCHEMA myschema CLONE otherschema
3882+ /// ```
3883+ ///
3884+ /// [Snowflake](https://docs.snowflake.com/en/sql-reference/sql/create-clone#databases-schemas)
3885+ clone : Option < ObjectName > ,
38783886 } ,
38793887 /// ```sql
38803888 /// CREATE DATABASE
@@ -3884,6 +3892,14 @@ pub enum Statement {
38843892 if_not_exists : bool ,
38853893 location : Option < String > ,
38863894 managed_location : Option < String > ,
3895+ /// Clones a database
3896+ ///
3897+ /// ```sql
3898+ /// CREATE DATABASE mydb CLONE otherdb
3899+ /// ```
3900+ ///
3901+ /// [Snowflake](https://docs.snowflake.com/en/sql-reference/sql/create-clone#databases-schemas)
3902+ clone : Option < ObjectName > ,
38873903 } ,
38883904 /// ```sql
38893905 /// CREATE FUNCTION
@@ -4826,6 +4842,7 @@ impl fmt::Display for Statement {
48264842 if_not_exists,
48274843 location,
48284844 managed_location,
4845+ clone,
48294846 } => {
48304847 write ! ( f, "CREATE DATABASE" ) ?;
48314848 if * if_not_exists {
@@ -4838,6 +4855,9 @@ impl fmt::Display for Statement {
48384855 if let Some ( ml) = managed_location {
48394856 write ! ( f, " MANAGEDLOCATION '{ml}'" ) ?;
48404857 }
4858+ if let Some ( clone) = clone {
4859+ write ! ( f, " CLONE {clone}" ) ?;
4860+ }
48414861 Ok ( ( ) )
48424862 }
48434863 Statement :: CreateFunction ( create_function) => create_function. fmt ( f) ,
@@ -5759,6 +5779,7 @@ impl fmt::Display for Statement {
57595779 with,
57605780 options,
57615781 default_collate_spec,
5782+ clone,
57625783 } => {
57635784 write ! (
57645785 f,
@@ -5779,6 +5800,9 @@ impl fmt::Display for Statement {
57795800 write ! ( f, " OPTIONS({})" , display_comma_separated( options) ) ?;
57805801 }
57815802
5803+ if let Some ( clone) = clone {
5804+ write ! ( f, " CLONE {clone}" ) ?;
5805+ }
57825806 Ok ( ( ) )
57835807 }
57845808 Statement :: Assert { condition, message } => {
0 commit comments