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

Method parse_protobuf_schema

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

Source from the content-addressed store, hash-verified

2284 }
2285
2286 fn parse_protobuf_schema(&mut self) -> Result<ProtobufSchema<Raw>, ParserError> {
2287 if self.parse_keywords(&[USING, CONFLUENT, SCHEMA, REGISTRY]) {
2288 let csr_connection = self.parse_csr_connection_proto()?;
2289 Ok(ProtobufSchema::Csr { csr_connection })
2290 } else if self.parse_keyword(MESSAGE) {
2291 let message_name = self.parse_literal_string()?;
2292 self.expect_keyword(USING)?;
2293 self.expect_keyword(SCHEMA)?;
2294 let schema = Schema {
2295 schema: self.parse_literal_string()?,
2296 };
2297 Ok(ProtobufSchema::InlineSchema {
2298 message_name,
2299 schema,
2300 })
2301 } else {
2302 self.expected(
2303 self.peek_pos(),
2304 "CONFLUENT SCHEMA REGISTRY or MESSAGE",
2305 self.peek_token(),
2306 )
2307 }
2308 }
2309
2310 fn parse_csr_connection_reference(&mut self) -> Result<CsrConnection<Raw>, ParserError> {
2311 self.expect_keyword(CONNECTION)?;

Callers 1

parse_formatMethod · 0.80

Calls 8

parse_keywordsMethod · 0.80
parse_keywordMethod · 0.80
parse_literal_stringMethod · 0.80
expect_keywordMethod · 0.80
expectedMethod · 0.80
peek_posMethod · 0.80
peek_tokenMethod · 0.80

Tested by

no test coverage detected