| 249 | use crate::control::security::catalog::trigger_types::*; |
| 250 | |
| 251 | fn sample(name: &str, coll: &str, timing: TriggerTiming, insert: bool) -> StoredTrigger { |
| 252 | StoredTrigger { |
| 253 | tenant_id: 1, |
| 254 | name: name.to_string(), |
| 255 | collection: coll.to_string(), |
| 256 | timing, |
| 257 | events: TriggerEvents { |
| 258 | on_insert: insert, |
| 259 | on_update: false, |
| 260 | on_delete: false, |
| 261 | }, |
| 262 | granularity: TriggerGranularity::Row, |
| 263 | when_condition: None, |
| 264 | body_sql: "BEGIN RETURN; END".into(), |
| 265 | priority: 0, |
| 266 | enabled: true, |
| 267 | execution_mode: TriggerExecutionMode::default(), |
| 268 | security: TriggerSecurity::default(), |
| 269 | batch_mode: TriggerBatchMode::default(), |
| 270 | owner: "admin".into(), |
| 271 | created_at: 0, |
| 272 | descriptor_version: 0, |
| 273 | modification_hlc: nodedb_types::Hlc::ZERO, |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | #[test] |
| 278 | fn register_and_match() { |