pub struct Statement { /* private fields */ }
Expand description
SQL prepared statement.
Implementations§
source§impl Statement
impl Statement
sourcepub fn execute_raw<IN>(&self, bind_params: &IN) -> Result<impl Read>where
IN: Serialize,
pub fn execute_raw<IN>(&self, bind_params: &IN) -> Result<impl Read>where
IN: Serialize,
Executes prepared statement and returns a wrapper over the raw msgpack bytes.
sourcepub fn execute<IN, OUT>(&self, bind_params: &IN) -> Result<OUT>where
IN: Serialize,
OUT: DeserializeOwned,
pub fn execute<IN, OUT>(&self, bind_params: &IN) -> Result<OUT>where
IN: Serialize,
OUT: DeserializeOwned,
Executes a returning data prepared statement with binding variables.
Example:
#[cfg(feature = "picodata")]
{
use tarantool::sql;
let stmt = sql::prepare("SELECT * FROM S WHERE ID > ?").unwrap();
let result: Vec<(u8, String)> = stmt.execute(&(100,)).unwrap();
println!("SQL query result: {:?}", result);
}
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Statement
impl !Send for Statement
impl !Sync for Statement
impl Unpin for Statement
impl UnwindSafe for Statement
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