MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / sample

Function sample

nodedb/src/control/trigger/registry.rs:251–275  ·  view source on GitHub ↗
(name: &str, coll: &str, timing: TriggerTiming, insert: bool)

Source from the content-addressed store, hash-verified

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() {

Callers 6

register_and_matchFunction · 0.70
no_match_wrong_eventFunction · 0.70
disabled_not_matchedFunction · 0.70
sorted_by_priorityFunction · 0.70
unregisterFunction · 0.70

Calls 1

to_stringMethod · 0.80

Tested by 6

register_and_matchFunction · 0.56
no_match_wrong_eventFunction · 0.56
disabled_not_matchedFunction · 0.56
sorted_by_priorityFunction · 0.56
unregisterFunction · 0.56