uqa_execution/mutation/
events.rs1use super::triggers::{
10 context::TriggerContext,
11 events::{AfterRowEventSink, AfterRowEvents},
12};
13use uqa_core::DocId;
14use uqa_storage::document_store::Document;
15
16#[derive(Default)]
18pub struct MutationEventQueue {
19 after_rows: AfterRowEvents,
20}
21
22impl MutationEventQueue {
23 pub fn after_rows_mut(&mut self) -> &mut AfterRowEvents {
24 &mut self.after_rows
25 }
26
27 pub fn append_after_rows(
28 &mut self,
29 events: Vec<crate::mutation::triggers::AfterRowTriggerEvent>,
30 context: &TriggerContext<'_>,
31 ) -> Result<(), uqa_sql::SQLError> {
32 for event in events {
33 self.after_rows.push_event(event, context)?;
34 }
35 Ok(())
36 }
37
38 pub fn into_after_rows(self) -> AfterRowEvents {
39 self.after_rows
40 }
41}
42
43pub struct ReferentialRewritePreparation<'a> {
44 pub constraint_table: &'a str,
46 pub table: &'a str,
47 pub doc_id: DocId,
48 pub old_document: Document,
49 pub proposed_document: Document,
50 pub updated_columns: Vec<String>,
51}