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

Function extract_table_factor_name_alias

nodedb-sql/src/planner/merge.rs:320–333  ·  view source on GitHub ↗
(
    factor: &ast::TableFactor,
)

Source from the content-addressed store, hash-verified

318// ── Helpers ────────────────────────────────────────────────────────────────
319
320pub(super) fn extract_table_factor_name_alias(
321 factor: &ast::TableFactor,
322) -> Result<(String, Option<String>)> {
323 match factor {
324 ast::TableFactor::Table { name, alias, .. } => {
325 let table_name = normalize_object_name_checked(name)?;
326 let alias_str = alias.as_ref().map(|a| normalize_ident(&a.name));
327 Ok((table_name, alias_str))
328 }
329 other => Err(SqlError::Unsupported {
330 detail: format!("MERGE target must be a plain table name, not: {other}"),
331 }),
332 }
333}

Callers 1

plan_mergeFunction · 0.85

Calls 3

normalize_identFunction · 0.85
as_refMethod · 0.45

Tested by

no test coverage detected