pub struct Statement {
pub sql: String,
pub values: Option<Values>,
pub db_backend: DbBackend,
}Expand description
A SQL string together with its bound parameters, ready to send to a
connection. Build one yourself with
from_sql_and_values (or the
raw_sql! macro), or get one out of any query builder
via QueryTrait::build.
Fieldsยง
ยงsql: StringThe SQL text, with backend-specific placeholders for the values.
values: Option<Values>Bound parameter values, in the order they appear in sql. None
means the statement has no parameters.
db_backend: DbBackendBackend this statement was built for; both the SQL dialect and the placeholder style must match.
Implementationsยง
Sourceยงimpl Statement
impl Statement
Sourcepub fn from_string<T>(db_backend: DbBackend, stmt: T) -> Statement
pub fn from_string<T>(db_backend: DbBackend, stmt: T) -> Statement
Create a Statement from a crate::DatabaseBackend and a raw SQL statement
Sourcepub fn from_sql_and_values<I, T>(
db_backend: DbBackend,
sql: T,
values: I,
) -> Self
pub fn from_sql_and_values<I, T>( db_backend: DbBackend, sql: T, values: I, ) -> Self
Create a SQL statement from a crate::DatabaseBackend, a raw SQL statement and param values
Trait Implementationsยง
Sourceยงimpl PartialEq for Statement
impl PartialEq for Statement
impl StructuralPartialEq for Statement
Auto Trait Implementationsยง
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnsafeUnpin for Statement
impl UnwindSafe for Statement
Blanket Implementationsยง
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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