@@ -1144,7 +1144,7 @@ pub enum Expr {
11441144 ///
11451145 /// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/functions#higher-order-functions---operator-and-lambdaparams-expr-function)
11461146 /// [Databricks](https://docs.databricks.com/en/sql/language-manual/sql-ref-lambda-functions.html)
1147- /// [DuckDb ](https://duckdb.org/docs/sql/functions/lambda.html )
1147+ /// [DuckDB ](https://duckdb.org/docs/stable/ sql/functions/lambda)
11481148 Lambda ( LambdaFunction ) ,
11491149 /// Checks membership of a value in a JSON array
11501150 MemberOf ( MemberOf ) ,
@@ -4366,6 +4366,15 @@ pub enum Statement {
43664366 ///
43674367 /// See [ReturnStatement]
43684368 Return ( ReturnStatement ) ,
4369+ /// Export data statement
4370+ ///
4371+ /// Example:
4372+ /// ```sql
4373+ /// EXPORT DATA OPTIONS(uri='gs://bucket/folder/*', format='PARQUET', overwrite=true) AS
4374+ /// SELECT field1, field2 FROM mydataset.table1 ORDER BY field1 LIMIT 10
4375+ /// ```
4376+ /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/export-statements)
4377+ ExportData ( ExportData ) ,
43694378 /// ```sql
43704379 /// CREATE [OR REPLACE] USER <user> [IF NOT EXISTS]
43714380 /// ```
@@ -6209,6 +6218,7 @@ impl fmt::Display for Statement {
62096218 Statement :: Return ( r) => write ! ( f, "{r}" ) ,
62106219 Statement :: List ( command) => write ! ( f, "LIST {command}" ) ,
62116220 Statement :: Remove ( command) => write ! ( f, "REMOVE {command}" ) ,
6221+ Statement :: ExportData ( e) => write ! ( f, "{e}" ) ,
62126222 Statement :: CreateUser ( s) => write ! ( f, "{s}" ) ,
62136223 Statement :: AlterSchema {
62146224 name, operations, ..
@@ -6791,6 +6801,7 @@ pub enum ActionCreateObjectType {
67916801 OrganiationListing ,
67926802 ReplicationGroup ,
67936803 Role ,
6804+ Schema ,
67946805 Share ,
67956806 User ,
67966807 Warehouse ,
@@ -6812,6 +6823,7 @@ impl fmt::Display for ActionCreateObjectType {
68126823 ActionCreateObjectType :: OrganiationListing => write ! ( f, "ORGANIZATION LISTING" ) ,
68136824 ActionCreateObjectType :: ReplicationGroup => write ! ( f, "REPLICATION GROUP" ) ,
68146825 ActionCreateObjectType :: Role => write ! ( f, "ROLE" ) ,
6826+ ActionCreateObjectType :: Schema => write ! ( f, "SCHEMA" ) ,
68156827 ActionCreateObjectType :: Share => write ! ( f, "SHARE" ) ,
68166828 ActionCreateObjectType :: User => write ! ( f, "USER" ) ,
68176829 ActionCreateObjectType :: Warehouse => write ! ( f, "WAREHOUSE" ) ,
@@ -7049,6 +7061,8 @@ pub enum GrantObjects {
70497061 AllMaterializedViewsInSchema { schemas : Vec < ObjectName > } ,
70507062 /// Grant privileges on `ALL EXTERNAL TABLES IN SCHEMA <schema_name> [, ...]`
70517063 AllExternalTablesInSchema { schemas : Vec < ObjectName > } ,
7064+ /// Grant privileges on `ALL FUNCTIONS IN SCHEMA <schema_name> [, ...]`
7065+ AllFunctionsInSchema { schemas : Vec < ObjectName > } ,
70527066 /// Grant privileges on `FUTURE SCHEMAS IN DATABASE <database_name> [, ...]`
70537067 FutureSchemasInDatabase { databases : Vec < ObjectName > } ,
70547068 /// Grant privileges on `FUTURE TABLES IN SCHEMA <schema_name> [, ...]`
@@ -7169,6 +7183,13 @@ impl fmt::Display for GrantObjects {
71697183 display_comma_separated( schemas)
71707184 )
71717185 }
7186+ GrantObjects :: AllFunctionsInSchema { schemas } => {
7187+ write ! (
7188+ f,
7189+ "ALL FUNCTIONS IN SCHEMA {}" ,
7190+ display_comma_separated( schemas)
7191+ )
7192+ }
71727193 GrantObjects :: FutureSchemasInDatabase { databases } => {
71737194 write ! (
71747195 f,
@@ -7844,6 +7865,7 @@ pub enum ObjectType {
78447865 Stage ,
78457866 Type ,
78467867 User ,
7868+ Stream ,
78477869}
78487870
78497871impl fmt:: Display for ObjectType {
@@ -7860,6 +7882,7 @@ impl fmt::Display for ObjectType {
78607882 ObjectType :: Stage => "STAGE" ,
78617883 ObjectType :: Type => "TYPE" ,
78627884 ObjectType :: User => "USER" ,
7885+ ObjectType :: Stream => "STREAM" ,
78637886 } )
78647887 }
78657888}
@@ -10151,6 +10174,34 @@ impl fmt::Display for MemberOf {
1015110174 }
1015210175}
1015310176
10177+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
10178+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
10179+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
10180+ pub struct ExportData {
10181+ pub options : Vec < SqlOption > ,
10182+ pub query : Box < Query > ,
10183+ pub connection : Option < ObjectName > ,
10184+ }
10185+
10186+ impl fmt:: Display for ExportData {
10187+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
10188+ if let Some ( connection) = & self . connection {
10189+ write ! (
10190+ f,
10191+ "EXPORT DATA WITH CONNECTION {connection} OPTIONS({}) AS {}" ,
10192+ display_comma_separated( & self . options) ,
10193+ self . query
10194+ )
10195+ } else {
10196+ write ! (
10197+ f,
10198+ "EXPORT DATA OPTIONS({}) AS {}" ,
10199+ display_comma_separated( & self . options) ,
10200+ self . query
10201+ )
10202+ }
10203+ }
10204+ }
1015410205/// Creates a user
1015510206///
1015610207/// Syntax:
0 commit comments