gluesql_core/store/
function.rs

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