Compare with another [`TableReference`] as if both are resolved. This allows comparing across variants. If a field is not present in both variants being compared then it is ignored in the comparison. e.g. this allows a [`TableReference::Bare`] to be considered equal to a fully qualified [`TableReference::Full`] if the table names match.
(&self, other: &Self)
| 194 | /// e.g. this allows a [`TableReference::Bare`] to be considered equal to a |
| 195 | /// fully qualified [`TableReference::Full`] if the table names match. |
| 196 | pub fn resolved_eq(&self, other: &Self) -> bool { |
| 197 | match self { |
| 198 | TableReference::Bare { table } => **table == *other.table(), |
| 199 | TableReference::Partial { schema, table } => { |
| 200 | **table == *other.table() && other.schema().is_none_or(|s| *s == **schema) |
| 201 | } |
| 202 | TableReference::Full { |
| 203 | catalog, |
| 204 | schema, |
| 205 | table, |
| 206 | } => { |
| 207 | **table == *other.table() |
| 208 | && other.schema().is_none_or(|s| *s == **schema) |
| 209 | && other.catalog().is_none_or(|c| *c == **catalog) |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | /// Given a default catalog and schema, ensure this table reference is fully |
| 215 | /// resolved |
no test coverage detected