ic_dbms_api/dbms/query/delete.rs
1use candid::CandidType;
2use serde::{Deserialize, Serialize};
3
4/// Defines the behavior for delete operations regarding foreign key constraints.
5#[derive(Debug, Clone, Copy, PartialEq, Eq, CandidType, Serialize, Deserialize)]
6pub enum DeleteBehavior {
7 /// Delete only the records matching the filter.
8 /// If there are foreign key constraints that would be violated, the operation will fail.
9 Restrict,
10 /// Cascade delete to related records.
11 /// Any records that reference the deleted records via foreign keys will also be deleted.
12 Cascade,
13 /// Break the foreign key references.
14 /// If there are foreign key constraints, the references will be broken.
15 /// Don't use this option unless you are sure what you're doing!
16 Break,
17}