@@ -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 } ;
@@ -2646,6 +2646,11 @@ pub enum Statement {
26462646 with_check : Option < Expr > ,
26472647 } ,
26482648 /// ```sql
2649+ /// CREATE CONNECTOR
2650+ /// ```
2651+ /// See [Hive](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27362034#LanguageManualDDL-CreateDataConnectorCreateConnector)
2652+ CreateConnector ( CreateConnector ) ,
2653+ /// ```sql
26492654 /// ALTER TABLE
26502655 /// ```
26512656 AlterTable {
@@ -2697,6 +2702,20 @@ pub enum Statement {
26972702 operation : AlterPolicyOperation ,
26982703 } ,
26992704 /// ```sql
2705+ /// ALTER CONNECTOR connector_name SET DCPROPERTIES(property_name=property_value, ...);
2706+ /// or
2707+ /// ALTER CONNECTOR connector_name SET URL new_url;
2708+ /// or
2709+ /// ALTER CONNECTOR connector_name SET OWNER [USER|ROLE] user_or_role;
2710+ /// ```
2711+ /// (Hive-specific)
2712+ AlterConnector {
2713+ name : Ident ,
2714+ properties : Option < Vec < SqlOption > > ,
2715+ url : Option < String > ,
2716+ owner : Option < ddl:: AlterConnectorOwner > ,
2717+ } ,
2718+ /// ```sql
27002719 /// ATTACH DATABASE 'path/to/file' AS alias
27012720 /// ```
27022721 /// (SQLite-specific)
@@ -2795,6 +2814,11 @@ pub enum Statement {
27952814 drop_behavior : Option < DropBehavior > ,
27962815 } ,
27972816 /// ```sql
2817+ /// DROP CONNECTOR
2818+ /// ```
2819+ /// See [Hive](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27362034#LanguageManualDDL-DropConnector)
2820+ DropConnector { if_exists : bool , name : Ident } ,
2821+ /// ```sql
27982822 /// DECLARE
27992823 /// ```
28002824 /// Declare Cursor Variables
@@ -4354,6 +4378,7 @@ impl fmt::Display for Statement {
43544378
43554379 Ok ( ( ) )
43564380 }
4381+ Statement :: CreateConnector ( create_connector) => create_connector. fmt ( f) ,
43574382 Statement :: AlterTable {
43584383 name,
43594384 if_exists,
@@ -4411,6 +4436,28 @@ impl fmt::Display for Statement {
44114436 } => {
44124437 write ! ( f, "ALTER POLICY {name} ON {table_name}{operation}" )
44134438 }
4439+ Statement :: AlterConnector {
4440+ name,
4441+ properties,
4442+ url,
4443+ owner,
4444+ } => {
4445+ write ! ( f, "ALTER CONNECTOR {name}" ) ?;
4446+ if let Some ( properties) = properties {
4447+ write ! (
4448+ f,
4449+ " SET DCPROPERTIES({})" ,
4450+ display_comma_separated( properties)
4451+ ) ?;
4452+ }
4453+ if let Some ( url) = url {
4454+ write ! ( f, " SET URL '{url}'" ) ?;
4455+ }
4456+ if let Some ( owner) = owner {
4457+ write ! ( f, " SET OWNER {owner}" ) ?;
4458+ }
4459+ Ok ( ( ) )
4460+ }
44144461 Statement :: Drop {
44154462 object_type,
44164463 if_exists,
@@ -4498,6 +4545,14 @@ impl fmt::Display for Statement {
44984545 }
44994546 Ok ( ( ) )
45004547 }
4548+ Statement :: DropConnector { if_exists, name } => {
4549+ write ! (
4550+ f,
4551+ "DROP CONNECTOR {if_exists}{name}" ,
4552+ if_exists = if * if_exists { "IF EXISTS " } else { "" }
4553+ ) ?;
4554+ Ok ( ( ) )
4555+ }
45014556 Statement :: Discard { object_type } => {
45024557 write ! ( f, "DISCARD {object_type}" ) ?;
45034558 Ok ( ( ) )
0 commit comments