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

Function convert_cte

nodedb/src/control/planner/sql_plan_convert/set_ops.rs:192–205  ·  view source on GitHub ↗
(
    definitions: &[(String, SqlPlan)],
    outer: &SqlPlan,
    tenant_id: TenantId,
    ctx: &ConvertContext,
)

Source from the content-addressed store, hash-verified

190}
191
192pub(super) fn convert_cte(
193 definitions: &[(String, SqlPlan)],
194 outer: &SqlPlan,
195 tenant_id: TenantId,
196 ctx: &ConvertContext,
197) -> crate::Result<Vec<PhysicalTask>> {
198 // Inline CTE definitions: replace scans on CTE names with the
199 // CTE's actual subquery plan.
200 let mut resolved = outer.clone();
201 for (name, cte_plan) in definitions {
202 resolved = inline_cte(&resolved, name, cte_plan);
203 }
204 convert_one(&resolved, tenant_id, ctx)
205}
206
207#[cfg(test)]
208mod tests {

Callers

nothing calls this directly

Calls 3

inline_cteFunction · 0.85
convert_oneFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected