(
&mut self,
)
| 3623 | } |
| 3624 | |
| 3625 | fn parse_create_source_connection( |
| 3626 | &mut self, |
| 3627 | ) -> Result<CreateSourceConnection<Raw>, ParserError> { |
| 3628 | match self.expect_one_of_keywords(&[KAFKA, POSTGRES, SQL, MYSQL, LOAD])? { |
| 3629 | POSTGRES => { |
| 3630 | self.expect_keyword(CONNECTION)?; |
| 3631 | let connection = self.parse_raw_name()?; |
| 3632 | |
| 3633 | let options = if self.consume_token(&Token::LParen) { |
| 3634 | let options = self.parse_comma_separated(Parser::parse_pg_connection_option)?; |
| 3635 | self.expect_token(&Token::RParen)?; |
| 3636 | options |
| 3637 | } else { |
| 3638 | vec![] |
| 3639 | }; |
| 3640 | |
| 3641 | Ok(CreateSourceConnection::Postgres { |
| 3642 | connection, |
| 3643 | options, |
| 3644 | }) |
| 3645 | } |
| 3646 | SQL => { |
| 3647 | self.expect_keywords(&[SERVER, CONNECTION])?; |
| 3648 | let connection = self.parse_raw_name()?; |
| 3649 | |
| 3650 | let options = if self.consume_token(&Token::LParen) { |
| 3651 | let options = |
| 3652 | self.parse_comma_separated(Parser::parse_sql_server_connection_option)?; |
| 3653 | self.expect_token(&Token::RParen)?; |
| 3654 | options |
| 3655 | } else { |
| 3656 | vec![] |
| 3657 | }; |
| 3658 | |
| 3659 | Ok(CreateSourceConnection::SqlServer { |
| 3660 | connection, |
| 3661 | options, |
| 3662 | }) |
| 3663 | } |
| 3664 | MYSQL => { |
| 3665 | self.expect_keyword(CONNECTION)?; |
| 3666 | let connection = self.parse_raw_name()?; |
| 3667 | |
| 3668 | let options = if self.consume_token(&Token::LParen) { |
| 3669 | let options = |
| 3670 | self.parse_comma_separated(Parser::parse_mysql_connection_option)?; |
| 3671 | self.expect_token(&Token::RParen)?; |
| 3672 | options |
| 3673 | } else { |
| 3674 | vec![] |
| 3675 | }; |
| 3676 | |
| 3677 | Ok(CreateSourceConnection::MySql { |
| 3678 | connection, |
| 3679 | options, |
| 3680 | }) |
| 3681 | } |
| 3682 | KAFKA => { |
no test coverage detected