Does this expression return this field?
(&self, field: &str)
| 311 | |
| 312 | /// Does this expression return this field? |
| 313 | pub fn has_field(&self, field: &str) -> bool { |
| 314 | match self { |
| 315 | Self::RelVar(Relvar { alias, .. }) => alias.as_ref() == field, |
| 316 | Self::LeftDeepJoin(join) | Self::EqJoin(join, ..) => { |
| 317 | join.rhs.alias.as_ref() == field || join.lhs.has_field(field) |
| 318 | } |
| 319 | Self::Select(input, _) => input.has_field(field), |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | /// Return the [`TableOrViewSchema`] for a relvar in the expression |
| 324 | pub fn find_table_schema(&self, alias: &str) -> Option<&TableOrViewSchema> { |