uqa_execution/mutation/
errors.rs1use uqa_core::DocId;
9use uqa_sql::SQLError;
10
11pub use uqa_sql::catalog::errors::dml_storage_error;
12
13pub use crate::storage_errors::storage_error as identifier_storage_error;
14
15pub fn missing_document_error(action: &str, table: &str, doc_id: DocId) -> SQLError {
16 SQLError::Internal(format!(
17 "{action}: document {doc_id} listed by table `{table}` disappeared during the statement"
18 ))
19}
20
21pub fn triggered_modification_error(operation: &str) -> SQLError {
23 SQLError::Diagnostic {
24 sqlstate: "27000".into(),
25 message: format!(
26 "tuple to be {operation} was already modified by an operation triggered by the current command"
27 ),
28 detail: None,
29 hint: Some(
30 "Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows."
31 .into(),
32 ),
33 }
34}