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

Method parse_join_constraint

src/sql-parser/src/parser.rs:8576–8594  ·  view source on GitHub ↗
(&mut self, natural: bool)

Source from the content-addressed store, hash-verified

8574 }
8575
8576 fn parse_join_constraint(&mut self, natural: bool) -> Result<JoinConstraint<Raw>, ParserError> {
8577 if natural {
8578 Ok(JoinConstraint::Natural)
8579 } else if self.parse_keyword(ON) {
8580 let constraint = self.parse_expr()?;
8581 Ok(JoinConstraint::On(constraint))
8582 } else if self.parse_keyword(USING) {
8583 let columns = self.parse_parenthesized_column_list(Mandatory)?;
8584 let alias = self.parse_optional_alias(Keyword::is_reserved_in_table_alias)?;
8585
8586 Ok(JoinConstraint::Using { columns, alias })
8587 } else {
8588 self.expected(
8589 self.peek_pos(),
8590 "ON, or USING after JOIN",
8591 self.peek_token(),
8592 )
8593 }
8594 }
8595
8596 /// Parse an INSERT statement
8597 fn parse_insert(&mut self) -> Result<Statement<Raw>, ParserError> {

Callers 1

parse_table_and_joinsMethod · 0.80

Calls 7

parse_keywordMethod · 0.80
parse_exprMethod · 0.80
parse_optional_aliasMethod · 0.80
expectedMethod · 0.80
peek_posMethod · 0.80
peek_tokenMethod · 0.80

Tested by

no test coverage detected