pub struct ProcedureCall {
pub name: String,
pub schema: Option<String>,
pub parameters: Vec<Parameter>,
pub db_type: DatabaseType,
pub is_function: bool,
}Expand description
Builder for stored procedure calls.
Fields§
§name: StringProcedure/function name.
schema: Option<String>Schema name (optional).
parameters: Vec<Parameter>Parameters.
db_type: DatabaseTypeDatabase type for SQL generation.
is_function: boolWhether this is a function call (vs procedure).
Implementations§
Source§impl ProcedureCall
impl ProcedureCall
Sourcepub fn with_db_type(self, db_type: DatabaseType) -> Self
pub fn with_db_type(self, db_type: DatabaseType) -> Self
Set the database type.
Sourcepub fn param(
self,
name: impl Into<String>,
value: impl Into<FilterValue>,
) -> Self
pub fn param( self, name: impl Into<String>, value: impl Into<FilterValue>, ) -> Self
Add an input parameter.
Sourcepub fn in_param(
self,
name: impl Into<String>,
value: impl Into<FilterValue>,
) -> Self
pub fn in_param( self, name: impl Into<String>, value: impl Into<FilterValue>, ) -> Self
Add an input parameter (alias for param).
Sourcepub fn out_param_typed(
self,
name: impl Into<String>,
type_hint: impl Into<String>,
) -> Self
pub fn out_param_typed( self, name: impl Into<String>, type_hint: impl Into<String>, ) -> Self
Add an output parameter with type hint.
Sourcepub fn inout_param(
self,
name: impl Into<String>,
value: impl Into<FilterValue>,
) -> Self
pub fn inout_param( self, name: impl Into<String>, value: impl Into<FilterValue>, ) -> Self
Add an input/output parameter.
Sourcepub fn add_parameter(self, param: Parameter) -> Self
pub fn add_parameter(self, param: Parameter) -> Self
Add a raw parameter.
Sourcepub fn qualified_name(&self) -> Cow<'_, str>
pub fn qualified_name(&self) -> Cow<'_, str>
Get the fully qualified name.
Sourcepub fn has_outputs(&self) -> bool
pub fn has_outputs(&self) -> bool
Check if any parameters are OUT or INOUT.
Sourcepub fn input_values(&self) -> Vec<FilterValue>
pub fn input_values(&self) -> Vec<FilterValue>
Get input parameter values.
Sourcepub fn to_postgres_sql(&self) -> (String, Vec<FilterValue>)
pub fn to_postgres_sql(&self) -> (String, Vec<FilterValue>)
Generate SQL for PostgreSQL.
Sourcepub fn to_mysql_sql(&self) -> (String, Vec<FilterValue>)
pub fn to_mysql_sql(&self) -> (String, Vec<FilterValue>)
Generate SQL for MySQL.
Sourcepub fn to_mssql_sql(&self) -> (String, Vec<FilterValue>)
pub fn to_mssql_sql(&self) -> (String, Vec<FilterValue>)
Generate SQL for MSSQL.
Sourcepub fn to_sqlite_sql(&self) -> QueryResult<(String, Vec<FilterValue>)>
pub fn to_sqlite_sql(&self) -> QueryResult<(String, Vec<FilterValue>)>
Generate SQL for SQLite (only functions supported).
Sourcepub fn to_sql(&self) -> QueryResult<(String, Vec<FilterValue>)>
pub fn to_sql(&self) -> QueryResult<(String, Vec<FilterValue>)>
Generate SQL for the configured database type.
Trait Implementations§
Source§impl Clone for ProcedureCall
impl Clone for ProcedureCall
Source§fn clone(&self) -> ProcedureCall
fn clone(&self) -> ProcedureCall
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 moreAuto Trait Implementations§
impl Freeze for ProcedureCall
impl RefUnwindSafe for ProcedureCall
impl Send for ProcedureCall
impl Sync for ProcedureCall
impl Unpin for ProcedureCall
impl UnwindSafe for ProcedureCall
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