Return the [`TableOrViewSchema`] for a relvar in the expression
(&self, alias: &str)
| 322 | |
| 323 | /// Return the [`TableOrViewSchema`] for a relvar in the expression |
| 324 | pub fn find_table_schema(&self, alias: &str) -> Option<&TableOrViewSchema> { |
| 325 | match self { |
| 326 | Self::RelVar(relvar) if relvar.alias.as_ref() == alias => Some(&relvar.schema), |
| 327 | Self::Select(input, _) => input.find_table_schema(alias), |
| 328 | Self::EqJoin(LeftDeepJoin { rhs, .. }, ..) if rhs.alias.as_ref() == alias => Some(&rhs.schema), |
| 329 | Self::EqJoin(LeftDeepJoin { lhs, .. }, ..) => lhs.find_table_schema(alias), |
| 330 | Self::LeftDeepJoin(LeftDeepJoin { rhs, .. }) if rhs.alias.as_ref() == alias => Some(&rhs.schema), |
| 331 | Self::LeftDeepJoin(LeftDeepJoin { lhs, .. }) => lhs.find_table_schema(alias), |
| 332 | _ => None, |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | /// Return the [TableId] for a relvar in the expression |
| 337 | pub fn find_table_id(&self, alias: &str) -> Option<TableId> { |
no test coverage detected