Skip to main content

gluesql_core/store/
function.rs

1use crate::{
2    data::CustomFunction as StructCustomFunction,
3    result::{Error, Result},
4};
5
6pub trait CustomFunction {
7    fn fetch_function<'a>(&'a self, _func_name: &str) -> Result<Option<&'a StructCustomFunction>> {
8        Err(Error::StorageMsg(
9            "[Storage] CustomFunction is not supported".to_owned(),
10        ))
11    }
12
13    fn fetch_all_functions(&self) -> Result<Vec<&StructCustomFunction>> {
14        Err(Error::StorageMsg(
15            "[Storage] CustomFunction is not supported".to_owned(),
16        ))
17    }
18}
19
20pub trait CustomFunctionMut {
21    fn insert_function(&mut self, _func: StructCustomFunction) -> Result<()> {
22        Err(Error::StorageMsg(
23            "[Storage] CustomFunction is not supported".to_owned(),
24        ))
25    }
26
27    fn delete_function(&mut self, _func_name: &str) -> Result<()> {
28        Err(Error::StorageMsg(
29            "[Storage] CustomFunction is not supported".to_owned(),
30        ))
31    }
32}