pub struct AlterFunctionStatement { /* private fields */ }Expand description
ALTER FUNCTION statement builder
This struct provides a fluent API for constructing ALTER FUNCTION queries.
§Examples
use reinhardt_query::prelude::*;
// ALTER FUNCTION my_func RENAME TO new_func
let query = Query::alter_function()
.name("my_func")
.rename_to("new_func");
// ALTER FUNCTION my_func OWNER TO new_owner
let query = Query::alter_function()
.name("my_func")
.owner_to("new_owner");Implementations§
Source§impl AlterFunctionStatement
impl AlterFunctionStatement
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ALTER FUNCTION statement
§Examples
use reinhardt_query::prelude::*;
let query = Query::alter_function();Sourcepub fn take(&mut self) -> Self
pub fn take(&mut self) -> Self
Take the ownership of data in the current AlterFunctionStatement
Sourcepub fn name<N>(&mut self, name: N) -> &mut Selfwhere
N: IntoIden,
pub fn name<N>(&mut self, name: N) -> &mut Selfwhere
N: IntoIden,
Set the function name
§Examples
use reinhardt_query::prelude::*;
let query = Query::alter_function()
.name("my_func");Sourcepub fn add_parameter<N: IntoIden, T: Into<String>>(
&mut self,
name: N,
param_type: T,
) -> &mut Self
pub fn add_parameter<N: IntoIden, T: Into<String>>( &mut self, name: N, param_type: T, ) -> &mut Self
Add a function parameter (for identifying which overloaded function to alter)
§Examples
use reinhardt_query::prelude::*;
let query = Query::alter_function()
.name("my_func")
.add_parameter("a", "integer")
.rename_to("new_func");Sourcepub fn rename_to<N: IntoIden>(&mut self, new_name: N) -> &mut Self
pub fn rename_to<N: IntoIden>(&mut self, new_name: N) -> &mut Self
RENAME TO new_name
§Examples
use reinhardt_query::prelude::*;
let query = Query::alter_function()
.name("my_func")
.rename_to("new_func");Sourcepub fn owner_to<N: IntoIden>(&mut self, new_owner: N) -> &mut Self
pub fn owner_to<N: IntoIden>(&mut self, new_owner: N) -> &mut Self
OWNER TO new_owner
§Examples
use reinhardt_query::prelude::*;
let query = Query::alter_function()
.name("my_func")
.owner_to("new_owner");Sourcepub fn set_schema<N: IntoIden>(&mut self, new_schema: N) -> &mut Self
pub fn set_schema<N: IntoIden>(&mut self, new_schema: N) -> &mut Self
SET SCHEMA new_schema
§Examples
use reinhardt_query::prelude::*;
let query = Query::alter_function()
.name("my_func")
.set_schema("new_schema");Sourcepub fn set_behavior(&mut self, behavior: FunctionBehavior) -> &mut Self
pub fn set_behavior(&mut self, behavior: FunctionBehavior) -> &mut Self
Set behavior (IMMUTABLE/STABLE/VOLATILE)
§Examples
use reinhardt_query::prelude::*;
use reinhardt_query::types::function::FunctionBehavior;
let query = Query::alter_function()
.name("my_func")
.set_behavior(FunctionBehavior::Immutable);Sourcepub fn set_security(&mut self, security: FunctionSecurity) -> &mut Self
pub fn set_security(&mut self, security: FunctionSecurity) -> &mut Self
Set security (DEFINER/INVOKER)
§Examples
use reinhardt_query::prelude::*;
use reinhardt_query::types::function::FunctionSecurity;
let query = Query::alter_function()
.name("my_func")
.set_security(FunctionSecurity::Definer);Trait Implementations§
Source§impl Clone for AlterFunctionStatement
impl Clone for AlterFunctionStatement
Source§fn clone(&self) -> AlterFunctionStatement
fn clone(&self) -> AlterFunctionStatement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AlterFunctionStatement
impl Debug for AlterFunctionStatement
Source§impl Default for AlterFunctionStatement
impl Default for AlterFunctionStatement
Source§impl QueryStatementBuilder for AlterFunctionStatement
impl QueryStatementBuilder for AlterFunctionStatement
Source§fn build_any(&self, query_builder: &dyn QueryBuilderTrait) -> (String, Values)
fn build_any(&self, query_builder: &dyn QueryBuilderTrait) -> (String, Values)
Build SQL statement for a database backend and collect query parameters Read more
impl QueryStatementWriter for AlterFunctionStatement
Auto Trait Implementations§
impl Freeze for AlterFunctionStatement
impl !RefUnwindSafe for AlterFunctionStatement
impl !Send for AlterFunctionStatement
impl !Sync for AlterFunctionStatement
impl Unpin for AlterFunctionStatement
impl UnsafeUnpin for AlterFunctionStatement
impl !UnwindSafe for AlterFunctionStatement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more