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

Method get_function

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

Get a single function by tenant_id + name.

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

Source from the content-addressed store, hash-verified

31
32 /// Get a single function by tenant_id + name.
33 pub fn get_function(
34 &self,
35 tenant_id: u64,
36 name: &str,
37 ) -> crate::Result<Option<StoredFunction>> {
38 let key = function_key(tenant_id, name);
39 let read_txn = self
40 .db
41 .begin_read()
42 .map_err(|e| catalog_err("read txn", e))?;
43 let table = read_txn
44 .open_table(FUNCTIONS)
45 .map_err(|e| catalog_err("open functions", e))?;
46 match table.get(key.as_str()) {
47 Ok(Some(value)) => {
48 let func: StoredFunction = zerompk::from_msgpack(value.value())
49 .map_err(|e| catalog_err("deser function", e))?;
50 Ok(Some(func))
51 }
52 Ok(None) => Ok(None),
53 Err(e) => Err(catalog_err("get function", e)),
54 }
55 }
56
57 /// Delete a function by tenant_id + name.
58 ///

Callers 15

has_functionMethod · 0.80
function_descriptorMethod · 0.80
put_and_getFunction · 0.80
replace_overwritesFunction · 0.80
stampFunction · 0.80
lookup_current_versionFunction · 0.80
create_wasm_functionFunction · 0.80
create_wasm_aggregateFunction · 0.80
alter_functionFunction · 0.80
alter_function_limitsFunction · 0.80
drop_functionFunction · 0.80

Calls 4

function_keyFunction · 0.85
catalog_errFunction · 0.70
getMethod · 0.45
as_strMethod · 0.45

Tested by 4

has_functionMethod · 0.64
function_descriptorMethod · 0.64
put_and_getFunction · 0.64
replace_overwritesFunction · 0.64