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

Function sample_function

nodedb/src/control/security/catalog/functions.rs:144–167  ·  view source on GitHub ↗
(tenant_id: u64, name: &str)

Source from the content-addressed store, hash-verified

142 }
143
144 fn sample_function(tenant_id: u64, name: &str) -> StoredFunction {
145 StoredFunction {
146 tenant_id,
147 name: name.to_string(),
148 parameters: vec![FunctionParam {
149 name: "email".into(),
150 data_type: "TEXT".into(),
151 }],
152 return_type: "TEXT".into(),
153 body_sql: "SELECT LOWER(TRIM(email))".into(),
154 compiled_body_sql: None,
155 volatility: FunctionVolatility::Immutable,
156 security: crate::control::security::catalog::FunctionSecurity::default(),
157 language: crate::control::security::catalog::function_types::FunctionLanguage::default(
158 ),
159 wasm_hash: None,
160 wasm_fuel: 1_000_000,
161 wasm_memory: 16 * 1024 * 1024,
162 owner: "admin".into(),
163 created_at: 1000,
164 descriptor_version: 0,
165 modification_hlc: nodedb_types::Hlc::ZERO,
166 }
167 }
168
169 #[test]
170 fn put_and_get() {

Callers 4

put_and_getFunction · 0.85
delete_functionFunction · 0.85
load_for_tenant_filtersFunction · 0.85
replace_overwritesFunction · 0.85

Calls 1

to_stringMethod · 0.80

Tested by 4

put_and_getFunction · 0.68
delete_functionFunction · 0.68
load_for_tenant_filtersFunction · 0.68
replace_overwritesFunction · 0.68