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

Function extract_col_ref

nodedb-sql/src/planner/join/constraint.rs:127–142  ·  view source on GitHub ↗
(expr: &ast::Expr)

Source from the content-addressed store, hash-verified

125}
126
127fn extract_col_ref(expr: &ast::Expr) -> Option<String> {
128 match expr {
129 ast::Expr::Identifier(ident) => Some(normalize_ident(ident)),
130 // Two-part: table.column — preserve the qualified form as the join key.
131 ast::Expr::CompoundIdentifier(parts) if parts.len() == 2 => Some(format!(
132 "{}.{}",
133 normalize_ident(&parts[0]),
134 normalize_ident(&parts[1])
135 )),
136 // Three or more parts: schema.table.column — reject by returning None;
137 // the caller will push the expression into non_equi which convert_expr
138 // then rejects with SqlError::Unsupported.
139 ast::Expr::CompoundIdentifier(_) => None,
140 _ => None,
141 }
142}

Callers 1

extract_equi_keysFunction · 0.85

Calls 2

normalize_identFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected