mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +00:00
fdw_name -> foreign_data_wrapper + fmt fix
This commit is contained in:
parent
cd78c51bfe
commit
1b916b8781
3 changed files with 9 additions and 10 deletions
|
@ -3324,7 +3324,7 @@ pub enum Statement {
|
||||||
if_not_exists: bool,
|
if_not_exists: bool,
|
||||||
server_type: Option<Ident>,
|
server_type: Option<Ident>,
|
||||||
version: Option<Ident>,
|
version: Option<Ident>,
|
||||||
fdw_name: ObjectName,
|
foreign_data_wrapper: ObjectName,
|
||||||
options: Option<Vec<ServerOption>>,
|
options: Option<Vec<ServerOption>>,
|
||||||
},
|
},
|
||||||
/// ```sql
|
/// ```sql
|
||||||
|
@ -5192,7 +5192,7 @@ impl fmt::Display for Statement {
|
||||||
if_not_exists,
|
if_not_exists,
|
||||||
server_type,
|
server_type,
|
||||||
version,
|
version,
|
||||||
fdw_name,
|
foreign_data_wrapper,
|
||||||
options,
|
options,
|
||||||
} => {
|
} => {
|
||||||
write!(
|
write!(
|
||||||
|
@ -5209,7 +5209,7 @@ impl fmt::Display for Statement {
|
||||||
write!(f, "VERSION {v} ")?;
|
write!(f, "VERSION {v} ")?;
|
||||||
}
|
}
|
||||||
|
|
||||||
write!(f, "FOREIGN DATA WRAPPER {fdw_name}")?;
|
write!(f, "FOREIGN DATA WRAPPER {foreign_data_wrapper}")?;
|
||||||
|
|
||||||
if let Some(o) = options {
|
if let Some(o) = options {
|
||||||
write!(f, " OPTIONS ({o})", o = display_comma_separated(o))?;
|
write!(f, " OPTIONS ({o})", o = display_comma_separated(o))?;
|
||||||
|
|
|
@ -4662,8 +4662,7 @@ impl<'a> Parser<'a> {
|
||||||
self.parse_create_procedure(or_alter)
|
self.parse_create_procedure(or_alter)
|
||||||
} else if self.parse_keyword(Keyword::CONNECTOR) {
|
} else if self.parse_keyword(Keyword::CONNECTOR) {
|
||||||
self.parse_create_connector()
|
self.parse_create_connector()
|
||||||
} else if self.parse_keyword(Keyword::SERVER)
|
} else if self.parse_keyword(Keyword::SERVER) {
|
||||||
{
|
|
||||||
self.parse_pg_create_server()
|
self.parse_pg_create_server()
|
||||||
} else {
|
} else {
|
||||||
self.expected("an object type after CREATE", self.peek_token())
|
self.expected("an object type after CREATE", self.peek_token())
|
||||||
|
@ -15833,7 +15832,7 @@ impl<'a> Parser<'a> {
|
||||||
};
|
};
|
||||||
|
|
||||||
self.expect_keywords(&[Keyword::FOREIGN, Keyword::DATA, Keyword::WRAPPER])?;
|
self.expect_keywords(&[Keyword::FOREIGN, Keyword::DATA, Keyword::WRAPPER])?;
|
||||||
let fdw_name = self.parse_object_name(false)?;
|
let foreign_data_wrapper = self.parse_object_name(false)?;
|
||||||
|
|
||||||
let mut options = None;
|
let mut options = None;
|
||||||
if self.parse_keyword(Keyword::OPTIONS) {
|
if self.parse_keyword(Keyword::OPTIONS) {
|
||||||
|
@ -15851,7 +15850,7 @@ impl<'a> Parser<'a> {
|
||||||
if_not_exists: ine,
|
if_not_exists: ine,
|
||||||
server_type,
|
server_type,
|
||||||
version,
|
version,
|
||||||
fdw_name,
|
foreign_data_wrapper,
|
||||||
options,
|
options,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -6241,7 +6241,7 @@ fn parse_create_server() {
|
||||||
if_not_exists: false,
|
if_not_exists: false,
|
||||||
server_type: None,
|
server_type: None,
|
||||||
version: None,
|
version: None,
|
||||||
fdw_name: ObjectName::from(vec!["postgres_fdw".into()]),
|
foreign_data_wrapper: ObjectName::from(vec!["postgres_fdw".into()]),
|
||||||
options: None,
|
options: None,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -6261,7 +6261,7 @@ fn parse_create_server() {
|
||||||
quote_style: Some('\''),
|
quote_style: Some('\''),
|
||||||
span: Span::empty(),
|
span: Span::empty(),
|
||||||
}),
|
}),
|
||||||
fdw_name: ObjectName::from(vec!["postgres_fdw".into()]),
|
foreign_data_wrapper: ObjectName::from(vec!["postgres_fdw".into()]),
|
||||||
options: None,
|
options: None,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -6273,7 +6273,7 @@ fn parse_create_server() {
|
||||||
if_not_exists: false,
|
if_not_exists: false,
|
||||||
server_type: None,
|
server_type: None,
|
||||||
version: None,
|
version: None,
|
||||||
fdw_name: ObjectName::from(vec!["postgres_fdw".into()]),
|
foreign_data_wrapper: ObjectName::from(vec!["postgres_fdw".into()]),
|
||||||
options: Some(vec![
|
options: Some(vec![
|
||||||
ServerOption {
|
ServerOption {
|
||||||
key: "host".into(),
|
key: "host".into(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue