| 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() { |