pub struct TursoStatement { /* private fields */ }Implementations§
Source§impl TursoStatement
impl TursoStatement
Sourcepub fn n_change(&self) -> i64
pub fn n_change(&self) -> i64
return amount of row modifications (insert/delete operations) made by the most recent executed statement
Sourcepub fn parameters_count(&self) -> usize
pub fn parameters_count(&self) -> usize
returns parameters count for the statement
Sourcepub fn parameter_name(&self, index: usize) -> Option<String>
pub fn parameter_name(&self, index: usize) -> Option<String>
Returns the name of the parameter at the given 1-based index,
including its SQL prefix (e.g. :name, @name, $name).
Returns None for positional-only (?) parameters or out-of-range indices.
Sourcepub fn bind_positional(
&mut self,
index: usize,
value: Value,
) -> Result<(), TursoError>
pub fn bind_positional( &mut self, index: usize, value: Value, ) -> Result<(), TursoError>
binds positional parameter at the corresponding index (1-based)
Sourcepub fn named_position(
&mut self,
name: impl AsRef<str>,
) -> Result<usize, TursoError>
pub fn named_position( &mut self, name: impl AsRef<str>, ) -> Result<usize, TursoError>
named parameter position.
The name must include the SQL placeholder prefix, e.g. :name, @name, $name, or ?1.
Sourcepub fn step(
&mut self,
waker: Option<&Waker>,
) -> Result<TursoStatusCode, TursoError>
pub fn step( &mut self, waker: Option<&Waker>, ) -> Result<TursoStatusCode, TursoError>
make one execution step of the statement method returns TursoStatusCode::Done if execution is finished method returns TursoStatusCode::Row if execution generated a row method returns TursoStatusCode::Io if async_io was set and execution needs IO in order to make progress
Sourcepub fn execute(
&mut self,
waker: Option<&Waker>,
) -> Result<TursoExecutionResult, TursoError>
pub fn execute( &mut self, waker: Option<&Waker>, ) -> Result<TursoExecutionResult, TursoError>
execute statement to completion method returns TursoStatusCode::Done if execution completed method returns TursoStatusCode::Io if async_io was set and execution needs IO in order to make progress
Sourcepub fn run_io(&self) -> Result<(), TursoError>
pub fn run_io(&self) -> Result<(), TursoError>
run iteration of the IO backend
Sourcepub fn row_value(&self, index: usize) -> Result<Value, TursoError>
pub fn row_value(&self, index: usize) -> Result<Value, TursoError>
get row value as an owned Value
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
returns column count
Sourcepub fn column_name(&self, index: usize) -> Result<String, TursoError>
pub fn column_name(&self, index: usize) -> Result<String, TursoError>
returns column name
Sourcepub fn column_decltype(&self, index: usize) -> Option<String>
pub fn column_decltype(&self, index: usize) -> Option<String>
returns column declared type (e.g. “INTEGER”, “TEXT”, “DATETIME”, etc.)
Sourcepub fn column_type_info(&self, index: usize) -> Option<ColumnTypeInfo>
pub fn column_type_info(&self, index: usize) -> Option<ColumnTypeInfo>
Returns rich type information for the column at index.
Wraps turso_core::Statement::get_column_type_info. Returns None
when the statement has been finalized, when the index is out of
bounds, when the connection does not have the experimental custom-
types feature enabled (the underlying call errors and we surface that
as “no info”; the C ABI has no error channel), when the statement is
in EXPLAIN mode, or when the expression behind the column has no
determined affinity.
Sourcepub fn finalize(
&mut self,
waker: Option<&Waker>,
) -> Result<TursoStatusCode, TursoError>
pub fn finalize( &mut self, waker: Option<&Waker>, ) -> Result<TursoStatusCode, TursoError>
finalize statement execution this method must be called in the end of statement execution (either successfull or not)
Sourcepub fn reset(&mut self) -> Result<(), TursoError>
pub fn reset(&mut self) -> Result<(), TursoError>
reset internal statement state and bindings
Sourcepub fn to_capi(self: Box<Self>) -> *mut turso_statement_t
pub fn to_capi(self: Box<Self>) -> *mut turso_statement_t
helper method to get C raw container to the TursoStatement instance this method is used in the capi wrappers
Sourcepub unsafe fn ref_from_capi<'a>(
value: *const turso_statement_t,
) -> Result<&'a mut Self, TursoError>
pub unsafe fn ref_from_capi<'a>( value: *const turso_statement_t, ) -> Result<&'a mut Self, TursoError>
helper method to restore TursoStatement ref from C raw container this method is used in the capi wrappers
§Safety
value must be a pointer returned from Self::to_capi method
Sourcepub unsafe fn box_from_capi(value: *const turso_statement_t) -> Box<Self>
pub unsafe fn box_from_capi(value: *const turso_statement_t) -> Box<Self>
helper method to restore TursoStatement instance from C raw container this method is used in the capi wrappers
§Safety
value must be a pointer returned from Self::to_capi method
Trait Implementations§
Source§impl Drop for TursoStatement
impl Drop for TursoStatement
Auto Trait Implementations§
impl Freeze for TursoStatement
impl RefUnwindSafe for TursoStatement
impl Send for TursoStatement
impl Sync for TursoStatement
impl Unpin for TursoStatement
impl UnsafeUnpin for TursoStatement
impl UnwindSafe for TursoStatement
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more