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

Method delete_function

nodedb/src/control/security/catalog/functions.rs:60–78  ·  view source on GitHub ↗

Delete a function by tenant_id + name. Returns `true` if the function existed and was removed.

(&self, tenant_id: u64, name: &str)

Source from the content-addressed store, hash-verified

58 ///
59 /// Returns `true` if the function existed and was removed.
60 pub fn delete_function(&self, tenant_id: u64, name: &str) -> crate::Result<bool> {
61 let key = function_key(tenant_id, name);
62 let write_txn = self
63 .db
64 .begin_write()
65 .map_err(|e| catalog_err("write txn", e))?;
66 let existed;
67 {
68 let mut table = write_txn
69 .open_table(FUNCTIONS)
70 .map_err(|e| catalog_err("open functions", e))?;
71 existed = table
72 .remove(key.as_str())
73 .map_err(|e| catalog_err("remove function", e))?
74 .is_some();
75 }
76 write_txn.commit().map_err(|e| catalog_err("commit", e))?;
77 Ok(existed)
78 }
79
80 /// Load every user-defined function across all tenants. Used
81 /// by the startup integrity check and any cross-tenant audit.

Callers 2

deleteFunction · 0.80
drop_functionFunction · 0.80

Calls 6

function_keyFunction · 0.85
begin_writeMethod · 0.80
catalog_errFunction · 0.70
removeMethod · 0.45
as_strMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected