pub struct SpgStatement<'q> { /* private fields */ }Expand description
Prepared-statement handle. Holds:
- the source SQL (for
Statement::sql), - the embedded
StatementAST handle the engine cached during prepare, - the expected output columns (populated on first execute that returns rows; empty until then),
- an empty type-name → column-ordinal map shared with
SpgRow::ColumnIndex<&str>.
Implementations§
Trait Implementations§
Source§impl<'q> Clone for SpgStatement<'q>
impl<'q> Clone for SpgStatement<'q>
Source§fn clone(&self) -> SpgStatement<'q>
fn clone(&self) -> SpgStatement<'q>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ColumnIndex<SpgStatement<'_>> for &str
impl ColumnIndex<SpgStatement<'_>> for &str
Source§fn index(&self, stmt: &SpgStatement<'_>) -> Result<usize, Error>
fn index(&self, stmt: &SpgStatement<'_>) -> Result<usize, Error>
Returns a valid positional index into the row or statement,
ColumnIndexOutOfBounds, or,
ColumnNotFound.Source§impl ColumnIndex<SpgStatement<'_>> for usize
impl ColumnIndex<SpgStatement<'_>> for usize
Source§fn index(&self, stmt: &SpgStatement<'_>) -> Result<usize, Error>
fn index(&self, stmt: &SpgStatement<'_>) -> Result<usize, Error>
Returns a valid positional index into the row or statement,
ColumnIndexOutOfBounds, or,
ColumnNotFound.Source§impl<'q> Debug for SpgStatement<'q>
impl<'q> Debug for SpgStatement<'q>
Source§impl<'q> Statement<'q> for SpgStatement<'q>
impl<'q> Statement<'q> for SpgStatement<'q>
type Database = Spg
Source§fn to_owned(&self) -> SpgStatement<'static>
fn to_owned(&self) -> SpgStatement<'static>
Creates an owned statement from this statement reference. This copies
the original SQL text.
Source§fn parameters(&self) -> Option<Either<&[SpgTypeInfo], usize>>
fn parameters(&self) -> Option<Either<&[SpgTypeInfo], usize>>
Get the expected parameters for this statement. Read more
Source§fn columns(&self) -> &[SpgColumn]
fn columns(&self) -> &[SpgColumn]
Get the columns expected to be returned by executing this statement.
fn query(&self) -> Query<'_, Spg, SpgArguments<'_>>
fn query_with<'s, A>(&'s self, arguments: A) -> Query<'s, Spg, A>where
A: IntoArguments<'s, Spg>,
fn query_as<O>(&self) -> QueryAs<'_, Spg, O, SpgArguments<'_>>
fn query_as_with<'s, O, A>(&'s self, arguments: A) -> QueryAs<'s, Spg, O, A>
fn query_scalar<O>(&self) -> QueryScalar<'_, Spg, O, SpgArguments<'_>>
fn query_scalar_with<'s, O, A>( &'s self, arguments: A, ) -> QueryScalar<'s, Spg, O, A>
Source§fn column<I>(&self, index: I) -> &<Self::Database as Database>::Columnwhere
I: ColumnIndex<Self>,
fn column<I>(&self, index: I) -> &<Self::Database as Database>::Columnwhere
I: ColumnIndex<Self>,
Gets the column information at
index. Read moreSource§fn try_column<I>(
&self,
index: I,
) -> Result<&<Self::Database as Database>::Column, Error>where
I: ColumnIndex<Self>,
fn try_column<I>(
&self,
index: I,
) -> Result<&<Self::Database as Database>::Column, Error>where
I: ColumnIndex<Self>,
Gets the column information at
index or a ColumnIndexOutOfBounds error if out of bounds.Auto Trait Implementations§
impl<'q> Freeze for SpgStatement<'q>
impl<'q> RefUnwindSafe for SpgStatement<'q>
impl<'q> Send for SpgStatement<'q>
impl<'q> Sync for SpgStatement<'q>
impl<'q> Unpin for SpgStatement<'q>
impl<'q> UnsafeUnpin for SpgStatement<'q>
impl<'q> UnwindSafe for SpgStatement<'q>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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