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

Method parse_optional_table_alias

src/sql-parser/src/parser.rs:7220–7232  ·  view source on GitHub ↗

Parse `AS identifier` when the AS is describing a table-valued object, like in `... FROM generate_series(1, 10) AS t (col)`. In this case the alias is allowed to optionally name the columns in the table, in addition to the table itself.

(&mut self)

Source from the content-addressed store, hash-verified

7218 /// the alias is allowed to optionally name the columns in the table, in
7219 /// addition to the table itself.
7220 fn parse_optional_table_alias(&mut self) -> Result<Option<TableAlias>, ParserError> {
7221 match self.parse_optional_alias(Keyword::is_reserved_in_table_alias)? {
7222 Some(name) => {
7223 let columns = self.parse_parenthesized_column_list(Optional)?;
7224 Ok(Some(TableAlias {
7225 name,
7226 columns,
7227 strict: false,
7228 }))
7229 }
7230 None => Ok(None),
7231 }
7232 }
7233
7234 fn parse_deferred_item_name(&mut self) -> Result<DeferredItemName<Raw>, ParserError> {
7235 Ok(match self.parse_raw_name()? {

Callers 4

parse_deleteMethod · 0.80

Calls 2

parse_optional_aliasMethod · 0.80

Tested by

no test coverage detected