@@ -47,14 +47,14 @@ pub use self::dcl::{
4747 AlterRoleOperation , ResetConfig , RoleOption , SecondaryRoles , SetConfigValue , Use ,
4848} ;
4949pub use self :: ddl:: {
50- AlterColumnOperation , AlterIndexOperation , AlterPolicyOperation , AlterTableOperation ,
51- ClusteredBy , ColumnDef , ColumnOption , ColumnOptionDef , ColumnPolicy , ColumnPolicyProperty ,
52- ConstraintCharacteristics , CreateFunction , Deduplicate , DeferrableInitial , DropBehavior ,
53- GeneratedAs , GeneratedExpressionMode , IdentityParameters , IdentityProperty ,
54- IdentityPropertyFormatKind , IdentityPropertyKind , IdentityPropertyOrder , IndexOption ,
55- IndexType , KeyOrIndexDisplay , NullsDistinctOption , Owner , Partition , ProcedureParam ,
56- ReferentialAction , TableConstraint , TagsColumnOption , UserDefinedTypeCompositeAttributeDef ,
57- UserDefinedTypeRepresentation , ViewColumnDef ,
50+ AlterColumnOperation , AlterConnectorOwner , AlterIndexOperation , AlterPolicyOperation ,
51+ AlterTableOperation , ClusteredBy , ColumnDef , ColumnOption , ColumnOptionDef , ColumnPolicy ,
52+ ColumnPolicyProperty , ConstraintCharacteristics , CreateConnector , CreateFunction , Deduplicate ,
53+ DeferrableInitial , DropBehavior , GeneratedAs , GeneratedExpressionMode , IdentityParameters ,
54+ IdentityProperty , IdentityPropertyFormatKind , IdentityPropertyKind , IdentityPropertyOrder ,
55+ IndexOption , IndexType , KeyOrIndexDisplay , NullsDistinctOption , Owner , Partition ,
56+ ProcedureParam , ReferentialAction , TableConstraint , TagsColumnOption ,
57+ UserDefinedTypeCompositeAttributeDef , UserDefinedTypeRepresentation , ViewColumnDef ,
5858} ;
5959pub use self :: dml:: { CreateIndex , CreateTable , Delete , Insert } ;
6060pub use self :: operator:: { BinaryOperator , UnaryOperator } ;
@@ -2664,6 +2664,11 @@ pub enum Statement {
26642664 with_check : Option < Expr > ,
26652665 } ,
26662666 /// ```sql
2667+ /// CREATE CONNECTOR
2668+ /// ```
2669+ /// See [Hive](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27362034#LanguageManualDDL-CreateDataConnectorCreateConnector)
2670+ CreateConnector ( CreateConnector ) ,
2671+ /// ```sql
26672672 /// ALTER TABLE
26682673 /// ```
26692674 AlterTable {
@@ -2715,6 +2720,20 @@ pub enum Statement {
27152720 operation : AlterPolicyOperation ,
27162721 } ,
27172722 /// ```sql
2723+ /// ALTER CONNECTOR connector_name SET DCPROPERTIES(property_name=property_value, ...);
2724+ /// or
2725+ /// ALTER CONNECTOR connector_name SET URL new_url;
2726+ /// or
2727+ /// ALTER CONNECTOR connector_name SET OWNER [USER|ROLE] user_or_role;
2728+ /// ```
2729+ /// (Hive-specific)
2730+ AlterConnector {
2731+ name : Ident ,
2732+ properties : Option < Vec < SqlOption > > ,
2733+ url : Option < String > ,
2734+ owner : Option < ddl:: AlterConnectorOwner > ,
2735+ } ,
2736+ /// ```sql
27182737 /// ATTACH DATABASE 'path/to/file' AS alias
27192738 /// ```
27202739 /// (SQLite-specific)
@@ -2813,6 +2832,11 @@ pub enum Statement {
28132832 drop_behavior : Option < DropBehavior > ,
28142833 } ,
28152834 /// ```sql
2835+ /// DROP CONNECTOR
2836+ /// ```
2837+ /// See [Hive](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27362034#LanguageManualDDL-DropConnector)
2838+ DropConnector { if_exists : bool , name : Ident } ,
2839+ /// ```sql
28162840 /// DECLARE
28172841 /// ```
28182842 /// Declare Cursor Variables
@@ -4372,6 +4396,7 @@ impl fmt::Display for Statement {
43724396
43734397 Ok ( ( ) )
43744398 }
4399+ Statement :: CreateConnector ( create_connector) => create_connector. fmt ( f) ,
43754400 Statement :: AlterTable {
43764401 name,
43774402 if_exists,
@@ -4429,6 +4454,28 @@ impl fmt::Display for Statement {
44294454 } => {
44304455 write ! ( f, "ALTER POLICY {name} ON {table_name}{operation}" )
44314456 }
4457+ Statement :: AlterConnector {
4458+ name,
4459+ properties,
4460+ url,
4461+ owner,
4462+ } => {
4463+ write ! ( f, "ALTER CONNECTOR {name}" ) ?;
4464+ if let Some ( properties) = properties {
4465+ write ! (
4466+ f,
4467+ " SET DCPROPERTIES({})" ,
4468+ display_comma_separated( properties)
4469+ ) ?;
4470+ }
4471+ if let Some ( url) = url {
4472+ write ! ( f, " SET URL '{url}'" ) ?;
4473+ }
4474+ if let Some ( owner) = owner {
4475+ write ! ( f, " SET OWNER {owner}" ) ?;
4476+ }
4477+ Ok ( ( ) )
4478+ }
44324479 Statement :: Drop {
44334480 object_type,
44344481 if_exists,
@@ -4516,6 +4563,14 @@ impl fmt::Display for Statement {
45164563 }
45174564 Ok ( ( ) )
45184565 }
4566+ Statement :: DropConnector { if_exists, name } => {
4567+ write ! (
4568+ f,
4569+ "DROP CONNECTOR {if_exists}{name}" ,
4570+ if_exists = if * if_exists { "IF EXISTS " } else { "" }
4571+ ) ?;
4572+ Ok ( ( ) )
4573+ }
45194574 Statement :: Discard { object_type } => {
45204575 write ! ( f, "DISCARD {object_type}" ) ?;
45214576 Ok ( ( ) )
0 commit comments