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

Function extract_qualified_column

nodedb-sql/src/planner/subquery.rs:325–338  ·  view source on GitHub ↗

Extract table.column from a qualified identifier. Returns `None` for schema-qualified references (`schema.table.col`) — those are rejected upstream by `convert_expr` when the expression is fully evaluated.

(expr: &Expr)

Source from the content-addressed store, hash-verified

323/// Returns `None` for schema-qualified references (`schema.table.col`) — those
324/// are rejected upstream by `convert_expr` when the expression is fully evaluated.
325fn extract_qualified_column(expr: &Expr) -> Option<(String, String)> {
326 match expr {
327 Expr::CompoundIdentifier(parts) if parts.len() >= 3 => {
328 // Schema-qualified: cannot extract table/column sensibly.
329 // convert_expr will reject this path with Unsupported.
330 None
331 }
332 Expr::CompoundIdentifier(parts) if parts.len() == 2 => {
333 Some((normalize_ident(&parts[0]), normalize_ident(&parts[1])))
334 }
335 Expr::Identifier(ident) => Some((String::new(), normalize_ident(ident))),
336 _ => None,
337 }
338}
339
340fn is_comparison_op(op: &ast::BinaryOperator) -> bool {
341 matches!(

Callers 1

extract_correlated_eqFunction · 0.70

Calls 2

normalize_identFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected