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

Method get_matching

nodedb/src/control/trigger/registry.rs:136–155  ·  view source on GitHub ↗

Get all enabled triggers for a (tenant, collection) matching an event. Returns triggers sorted by (priority, name) — deterministic execution order.

(
        &self,
        tenant_id: u64,
        collection: &str,
        event: DmlEvent,
    )

Source from the content-addressed store, hash-verified

134 ///
135 /// Returns triggers sorted by (priority, name) — deterministic execution order.
136 pub fn get_matching(
137 &self,
138 tenant_id: u64,
139 collection: &str,
140 event: DmlEvent,
141 ) -> Vec<StoredTrigger> {
142 let map = match self.by_collection.read() {
143 Ok(m) => m,
144 Err(p) => p.into_inner(),
145 };
146 let key = (tenant_id, collection.to_string());
147 match map.get(&key) {
148 Some(list) => list
149 .iter()
150 .filter(|t| t.enabled && matches_event(t, event))
151 .cloned()
152 .collect(),
153 None => Vec::new(),
154 }
155 }
156
157 /// Replace the entire in-memory trigger map with `rows`.
158 /// Used by the catalog recovery sanity checker to repair

Callers 15

fire_after_statementFunction · 0.80
fire_before_insertFunction · 0.80
fire_before_updateFunction · 0.80
fire_before_deleteFunction · 0.80
fire_instead_of_insertFunction · 0.80
fire_instead_of_updateFunction · 0.80
fire_instead_of_deleteFunction · 0.80
has_triggersFunction · 0.80
fire_after_insertFunction · 0.80
fire_after_updateFunction · 0.80
fire_after_deleteFunction · 0.80

Calls 6

matches_eventFunction · 0.85
to_stringMethod · 0.80
collectMethod · 0.80
readMethod · 0.45
getMethod · 0.45
iterMethod · 0.45