MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_sql_server_connection_option

Method parse_sql_server_connection_option

src/sql-parser/src/parser.rs:3838–3890  ·  view source on GitHub ↗
(
        &mut self,
    )

Source from the content-addressed store, hash-verified

3836 }
3837
3838 fn parse_sql_server_connection_option(
3839 &mut self,
3840 ) -> Result<SqlServerConfigOption<Raw>, ParserError> {
3841 match self.expect_one_of_keywords(&[DETAILS, TEXT, EXCLUDE])? {
3842 DETAILS => Ok(SqlServerConfigOption {
3843 name: SqlServerConfigOptionName::Details,
3844 value: self.parse_optional_option_value()?,
3845 }),
3846 TEXT => {
3847 self.expect_keyword(COLUMNS)?;
3848
3849 let _ = self.consume_token(&Token::Eq);
3850
3851 let value = self
3852 .parse_option_sequence(Parser::parse_item_name)?
3853 .map(|inner| {
3854 WithOptionValue::Sequence(
3855 inner
3856 .into_iter()
3857 .map(WithOptionValue::UnresolvedItemName)
3858 .collect_vec(),
3859 )
3860 });
3861
3862 Ok(SqlServerConfigOption {
3863 name: SqlServerConfigOptionName::TextColumns,
3864 value,
3865 })
3866 }
3867 EXCLUDE => {
3868 self.expect_keyword(COLUMNS)?;
3869
3870 let _ = self.consume_token(&Token::Eq);
3871
3872 let value = self
3873 .parse_option_sequence(Parser::parse_item_name)?
3874 .map(|inner| {
3875 WithOptionValue::Sequence(
3876 inner
3877 .into_iter()
3878 .map(WithOptionValue::UnresolvedItemName)
3879 .collect_vec(),
3880 )
3881 });
3882
3883 Ok(SqlServerConfigOption {
3884 name: SqlServerConfigOptionName::ExcludeColumns,
3885 value,
3886 })
3887 }
3888 _ => unreachable!(),
3889 }
3890 }
3891
3892 fn parse_load_generator_option(&mut self) -> Result<LoadGeneratorOption<Raw>, ParserError> {
3893 let name = match self.expect_one_of_keywords(&[

Callers

nothing calls this directly

Calls 7

expect_keywordMethod · 0.80
consume_tokenMethod · 0.80
parse_option_sequenceMethod · 0.80
mapMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected