#[non_exhaustive]pub struct Statement {
pub sql: String,
pub params: Option<Struct>,
pub param_types: HashMap<String, Type>,
/* private fields */
}Expand description
A single DML statement.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sql: StringRequired. The DML string.
params: Option<Struct>Parameter names and values that bind to placeholders in the DML string.
A parameter placeholder consists of the @ character followed by the
parameter name (for example, @firstName). Parameter names can contain
letters, numbers, and underscores.
Parameters can appear anywhere that a literal value is expected. The same parameter name can be used more than once, for example:
"WHERE id > @msg_id AND id < @msg_id + 100"
It’s an error to execute a SQL statement with unbound parameters.
param_types: HashMap<String, Type>It isn’t always possible for Cloud Spanner to infer the right SQL type
from a JSON value. For example, values of type BYTES and values
of type STRING both appear in
params as
JSON strings.
In these cases, param_types can be used to specify the exact
SQL type for some or all of the SQL statement parameters. See the
definition of Type for more information
about SQL types.
Implementations§
Source§impl Statement
impl Statement
Sourcepub fn set_params<T>(self, v: T) -> Self
pub fn set_params<T>(self, v: T) -> Self
Sets the value of params.
Sourcepub fn set_or_clear_params<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_params<T>(self, v: Option<T>) -> Self
Sets or clears the value of params.
Sourcepub fn set_param_types<T, K, V>(self, v: T) -> Self
pub fn set_param_types<T, K, V>(self, v: T) -> Self
Sets the value of param_types.
Trait Implementations§
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§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request