MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / scan_alias_from_relation

Function scan_alias_from_relation

nodedb-sql/src/planner/join/plan.rs:154–162  ·  view source on GitHub ↗

Extract an alias (or table name) from a named-table `TableFactor`.

(factor: &ast::TableFactor)

Source from the content-addressed store, hash-verified

152
153/// Extract an alias (or table name) from a named-table `TableFactor`.
154fn scan_alias_from_relation(factor: &ast::TableFactor) -> Option<String> {
155 match factor {
156 ast::TableFactor::Table { name, alias, .. } => alias
157 .as_ref()
158 .map(|a| crate::parser::normalize::normalize_ident(&a.name))
159 .or_else(|| crate::parser::normalize::normalize_object_name_checked(name).ok()),
160 _ => None,
161 }
162}
163
164/// True when the join operator represents a LEFT join variant.
165fn is_left_join_operator(op: &ast::JoinOperator) -> bool {

Callers 1

plan_join_from_selectFunction · 0.85

Calls 4

normalize_identFunction · 0.85
as_refMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected