mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-21 23:40:38 +00:00
feat: add catalog_manager to ProcedureServiceHandler (#5873)
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
use async_trait::async_trait;
|
||||
use catalog::CatalogManagerRef;
|
||||
use common_error::ext::BoxedError;
|
||||
use common_function::handlers::ProcedureServiceHandler;
|
||||
use common_meta::ddl::{ExecutorContext, ProcedureExecutorRef};
|
||||
@@ -28,11 +29,18 @@ use snafu::ResultExt;
|
||||
#[derive(Clone)]
|
||||
pub struct ProcedureServiceOperator {
|
||||
procedure_executor: ProcedureExecutorRef,
|
||||
catalog_manager: CatalogManagerRef,
|
||||
}
|
||||
|
||||
impl ProcedureServiceOperator {
|
||||
pub fn new(procedure_executor: ProcedureExecutorRef) -> Self {
|
||||
Self { procedure_executor }
|
||||
pub fn new(
|
||||
procedure_executor: ProcedureExecutorRef,
|
||||
catalog_manager: CatalogManagerRef,
|
||||
) -> Self {
|
||||
Self {
|
||||
procedure_executor,
|
||||
catalog_manager,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,4 +83,8 @@ impl ProcedureServiceHandler for ProcedureServiceOperator {
|
||||
.map_err(BoxedError::new)
|
||||
.context(query_error::ProcedureServiceSnafu)
|
||||
}
|
||||
|
||||
fn catalog_manager(&self) -> &CatalogManagerRef {
|
||||
&self.catalog_manager
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user