quill_sql/plan/logical_plan/
insert.rs

1use crate::catalog::SchemaRef;
2use crate::plan::logical_plan::LogicalPlan;
3use crate::utils::table_ref::TableReference;
4use std::sync::Arc;
5
6#[derive(derive_new::new, Debug, Clone)]
7pub struct Insert {
8    pub table: TableReference,
9    pub table_schema: SchemaRef,
10    pub projected_schema: SchemaRef,
11    pub input: Arc<LogicalPlan>,
12}
13
14impl std::fmt::Display for Insert {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        write!(
17            f,
18            "Insert: {} ({})",
19            self.table,
20            self.projected_schema
21                .columns
22                .iter()
23                .map(|c| c.name.clone())
24                .collect::<Vec<_>>()
25                .join(", ")
26        )
27    }
28}