MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / find_table_schema

Method find_table_schema

crates/expr/src/expr.rs:324–334  ·  view source on GitHub ↗

Return the [`TableOrViewSchema`] for a relvar in the expression

(&self, alias: &str)

Source from the content-addressed store, hash-verified

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> {

Callers 2

return_tableMethod · 0.45
find_table_idMethod · 0.45

Calls 1

as_refMethod · 0.45

Tested by

no test coverage detected