uqa-execution 0.6.2

Volcano physical operators with row-batch pipelines
Documentation
//
// Unified Query Algebra
//
// Copyright (c) 2023-2026 Cognica, Inc.
//

//! Typed old and new row images shared by mutation RETURNING and event paths.

use crate::OwnedPhysicalRow;
use uqa_core::DocId;
use uqa_storage::{document_store::Document, DocumentMetadata};

#[derive(Clone)]
pub struct OwnedMutationImages {
    pub old_storage_table: Option<String>,
    pub old_doc_id: Option<DocId>,
    pub old: Option<Document>,
    pub new_storage_table: Option<String>,
    pub new_doc_id: Option<DocId>,
    pub new: Option<Document>,
    pub context: Option<OwnedPhysicalRow>,
}

impl OwnedMutationImages {
    pub fn empty() -> Self {
        Self {
            old_storage_table: None,
            old_doc_id: None,
            old: None,
            new_storage_table: None,
            new_doc_id: None,
            new: None,
            context: None,
        }
    }
}

#[derive(Clone)]
pub struct MutationRowImage<'a> {
    pub storage_table: String,
    pub doc_id: DocId,
    pub document: &'a Document,
    pub metadata: DocumentMetadata,
}

#[derive(Clone)]
pub struct MutationRowImages<'a> {
    pub old: Option<MutationRowImage<'a>>,
    pub new: Option<MutationRowImage<'a>>,
}

mod buffer;
pub use buffer::{MutationImageBuffer, MutationImages};