pub struct ProcedureBuilder<'a, S: ConnectionState> { /* private fields */ }Expand description
Builder for constructing stored procedure calls with named parameters.
Created via Client::procedure(). Supports both input and output
parameters with type-safe output declarations.
§Example
ⓘ
let result = client.procedure("dbo.CalculateSum")?
.input("@a", &10i32)
.input("@b", &20i32)
.output_int("@result")
.execute().await?;
// Access the output parameter
let output = result.get_output("@result").expect("output param present");
assert_eq!(output.value, SqlValue::Int(30));Implementations§
Source§impl<'a, S: ConnectionState> ProcedureBuilder<'a, S>
impl<'a, S: ConnectionState> ProcedureBuilder<'a, S>
Sourcepub fn output_int(&mut self, name: &str) -> &mut Self
pub fn output_int(&mut self, name: &str) -> &mut Self
Sourcepub fn output_bigint(&mut self, name: &str) -> &mut Self
pub fn output_bigint(&mut self, name: &str) -> &mut Self
Add a named output parameter of type BIGINT.
Sourcepub fn output_nvarchar(&mut self, name: &str, max_len: u16) -> &mut Self
pub fn output_nvarchar(&mut self, name: &str, max_len: u16) -> &mut Self
Add a named output parameter of type NVARCHAR with the given max length.
Use max_len = 0 for NVARCHAR(MAX).
Sourcepub fn output_bit(&mut self, name: &str) -> &mut Self
pub fn output_bit(&mut self, name: &str) -> &mut Self
Add a named output parameter of type BIT.
Sourcepub fn output_float(&mut self, name: &str) -> &mut Self
pub fn output_float(&mut self, name: &str) -> &mut Self
Add a named output parameter of type FLOAT (64-bit).
Sourcepub fn output_decimal(
&mut self,
name: &str,
precision: u8,
scale: u8,
) -> &mut Self
pub fn output_decimal( &mut self, name: &str, precision: u8, scale: u8, ) -> &mut Self
Add a named output parameter of type DECIMAL with given precision and scale.
Sourcepub fn output_raw(&mut self, name: &str, type_info: RpcTypeInfo) -> &mut Self
pub fn output_raw(&mut self, name: &str, type_info: RpcTypeInfo) -> &mut Self
Sourcepub async fn execute(&mut self) -> Result<ProcedureResult>
pub async fn execute(&mut self) -> Result<ProcedureResult>
Execute the stored procedure and return the result.
Sends an RPC request to SQL Server with the accumulated parameters and reads the complete response including result sets, output parameters, and the procedure return value.
Auto Trait Implementations§
impl<'a, S> Freeze for ProcedureBuilder<'a, S>
impl<'a, S> !RefUnwindSafe for ProcedureBuilder<'a, S>
impl<'a, S> Send for ProcedureBuilder<'a, S>where
S: Send,
impl<'a, S> Sync for ProcedureBuilder<'a, S>where
S: Sync,
impl<'a, S> Unpin for ProcedureBuilder<'a, S>
impl<'a, S> UnsafeUnpin for ProcedureBuilder<'a, S>
impl<'a, S> !UnwindSafe for ProcedureBuilder<'a, S>
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