-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…#828) * feat(function): add `CreateFunctionExecutor` & `bind_create_function` Signed-off-by: Michael Xu <[email protected]> * fix check Signed-off-by: Michael Xu <[email protected]> --------- Signed-off-by: Michael Xu <[email protected]>
- Loading branch information
Showing
8 changed files
with
175 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2024 RisingLight Project Authors. Licensed under Apache-2.0. | ||
|
||
use super::*; | ||
use crate::binder::CreateFunction; | ||
use crate::catalog::RootCatalogRef; | ||
|
||
/// The executor of `create function` statement. | ||
pub struct CreateFunctionExecutor { | ||
pub f: CreateFunction, | ||
pub catalog: RootCatalogRef, | ||
} | ||
|
||
impl CreateFunctionExecutor { | ||
#[try_stream(boxed, ok = DataChunk, error = ExecutorError)] | ||
pub async fn execute(self) { | ||
let CreateFunction { | ||
schema_name, | ||
name, | ||
arg_types, | ||
return_type, | ||
language, | ||
body, | ||
} = self.f; | ||
|
||
self.catalog.create_function( | ||
schema_name.clone(), | ||
name.clone(), | ||
arg_types, | ||
return_type, | ||
language, | ||
body, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters