Skip to main content

uni_query/query/df_graph/
mutation_set.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2024-2026 Dragonscale Team
3
4//! DataFusion ExecutionPlan for Cypher SET clauses.
5//!
6//! Thin wrapper around [`MutationExec`] with a typed constructor that builds
7//! the correct [`MutationKind::Set`] variant.
8
9use super::mutation_common::{MutationContext, MutationExec, MutationKind};
10use datafusion::physical_plan::ExecutionPlan;
11use std::sync::Arc;
12use uni_cypher::ast::SetItem;
13
14/// Type alias for a SET mutation execution plan.
15pub type MutationSetExec = MutationExec;
16
17/// Create a new `MutationExec` configured for a SET clause.
18pub fn new_set_exec(
19    input: Arc<dyn ExecutionPlan>,
20    items: Vec<SetItem>,
21    mutation_ctx: Arc<MutationContext>,
22) -> MutationSetExec {
23    MutationExec::new(
24        input,
25        MutationKind::Set { items },
26        "MutationSetExec",
27        mutation_ctx,
28    )
29}