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

Function make_trigger_full

nodedb/tests/trigger_execution.rs:20–54  ·  view source on GitHub ↗
(
    name: &str,
    collection: &str,
    timing: TriggerTiming,
    on_insert: bool,
    on_update: bool,
    on_delete: bool,
    mode: TriggerExecutionMode,
    granularity: TriggerGranularity,
 

Source from the content-addressed store, hash-verified

18
19#[allow(clippy::too_many_arguments)]
20fn make_trigger_full(
21 name: &str,
22 collection: &str,
23 timing: TriggerTiming,
24 on_insert: bool,
25 on_update: bool,
26 on_delete: bool,
27 mode: TriggerExecutionMode,
28 granularity: TriggerGranularity,
29 security: TriggerSecurity,
30) -> StoredTrigger {
31 StoredTrigger {
32 tenant_id: 1,
33 name: name.to_string(),
34 collection: collection.to_string(),
35 timing,
36 events: TriggerEvents {
37 on_insert,
38 on_update,
39 on_delete,
40 },
41 granularity,
42 when_condition: None,
43 body_sql: "BEGIN RETURN; END".into(),
44 priority: 0,
45 enabled: true,
46 execution_mode: mode,
47 security,
48 batch_mode: nodedb::control::security::catalog::trigger_types::TriggerBatchMode::default(),
49 owner: "admin".into(),
50 created_at: 0,
51 descriptor_version: 0,
52 modification_hlc: nodedb_types::Hlc::ZERO,
53 }
54}
55
56fn make_before_trigger(name: &str, collection: &str, event: DmlEvent) -> StoredTrigger {
57 make_trigger_full(

Calls 1

to_stringMethod · 0.80

Tested by

no test coverage detected