#[non_exhaustive]pub enum SqlExprParam {
Int(i64),
Numeric(String),
Bool(bool),
Text(String),
}Expand description
受控表达式的绑定参数值,同时作为 COALESCE / NULLIF 字面量的类型化载体。
从 &str / String 构造时按「安全推断」决定绑定类型:true / false 按布尔;
可解析为 i64 按整数;可解析为有限浮点/十进制按 numeric(保留原始十进制
文本,避免经 f64 丢精度);其余按文本。
推断对数字样式的文本列字面量是陷阱:COALESCE(text_col, "0012") 会按整数
绑定,UUID / JSONB 列上的 "0" 也无法安全推断——这类场景请用
SqlExprParam::text 强制文本(必要时由调用方配合列类型 cast 保证匹配)。
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Int(i64)
整数绑定参数。
Numeric(String)
精确十进制(numeric)绑定参数,保存原始十进制文本。
Bool(bool)
布尔绑定参数。
Text(String)
文本绑定参数。
Implementations§
Trait Implementations§
Source§impl Clone for SqlExprParam
impl Clone for SqlExprParam
Source§impl Debug for SqlExprParam
impl Debug for SqlExprParam
impl Eq for SqlExprParam
Source§impl From<&String> for SqlExprParam
impl From<&String> for SqlExprParam
Source§impl From<&str> for SqlExprParam
impl From<&str> for SqlExprParam
Source§impl From<SqlExprParam> for SqlValue
Available on crate feature mysql only.
impl From<SqlExprParam> for SqlValue
Available on crate feature
mysql only.Source§fn from(param: SqlExprParam) -> Self
fn from(param: SqlExprParam) -> Self
Converts to this type from the input type.
Source§impl From<SqlExprParam> for SqlValue
Available on crate feature postgres only.
impl From<SqlExprParam> for SqlValue
Available on crate feature
postgres only.Source§fn from(param: SqlExprParam) -> Self
fn from(param: SqlExprParam) -> Self
Converts to this type from the input type.
Source§impl From<String> for SqlExprParam
impl From<String> for SqlExprParam
Source§impl From<bool> for SqlExprParam
impl From<bool> for SqlExprParam
Source§impl From<f64> for SqlExprParam
impl From<f64> for SqlExprParam
Source§impl From<i64> for SqlExprParam
impl From<i64> for SqlExprParam
Source§impl PartialEq for SqlExprParam
impl PartialEq for SqlExprParam
impl StructuralPartialEq for SqlExprParam
Auto Trait Implementations§
impl Forget for SqlExprParam
impl Freeze for SqlExprParam
impl Move for SqlExprParam
impl RefUnwindSafe for SqlExprParam
impl Send for SqlExprParam
impl Sync for SqlExprParam
impl Unpin for SqlExprParam
impl UnsafeUnpin for SqlExprParam
impl UnwindSafe for SqlExprParam
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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