pub enum Value {
Show 30 variants
Null,
Boolean(Option<bool>),
Int8(Option<i8>),
Int16(Option<i16>),
Int32(Option<i32>),
Int64(Option<i64>),
Int128(Option<i128>),
UInt8(Option<u8>),
UInt16(Option<u16>),
UInt32(Option<u32>),
UInt64(Option<u64>),
UInt128(Option<u128>),
Float32(Option<f32>),
Float64(Option<f64>),
Decimal(Option<Decimal>, u8, u8),
Char(Option<char>),
Varchar(Option<Cow<'static, str>>),
Blob(Option<Box<[u8]>>),
Date(Option<Date>),
Time(Option<Time>),
Timestamp(Option<PrimitiveDateTime>),
TimestampWithTimezone(Option<OffsetDateTime>),
Interval(Option<Interval>),
Uuid(Option<Uuid>),
Array(Option<Box<[Value]>>, Box<Value>, u32),
List(Option<Vec<Value>>, Box<Value>),
Map(Option<HashMap<Value, Value>>, Box<Value>, Box<Value>),
Json(Option<Value>),
Struct(Option<Vec<(String, Value)>>, Vec<(String, Value)>, TableRef),
Unknown(Option<String>),
}Expand description
SQL value representation.
Variants correspond to database column types.
Variants§
Null
SQL NULL.
Boolean(Option<bool>)
Int8(Option<i8>)
Int16(Option<i16>)
Int32(Option<i32>)
Int64(Option<i64>)
Int128(Option<i128>)
UInt8(Option<u8>)
UInt16(Option<u16>)
UInt32(Option<u32>)
UInt64(Option<u64>)
UInt128(Option<u128>)
Float32(Option<f32>)
Float64(Option<f64>)
Decimal(Option<Decimal>, u8, u8)
Decimal (value, precision, scale).
Char(Option<char>)
Varchar(Option<Cow<'static, str>>)
Blob(Option<Box<[u8]>>)
Date(Option<Date>)
Time(Option<Time>)
Timestamp(Option<PrimitiveDateTime>)
TimestampWithTimezone(Option<OffsetDateTime>)
Interval(Option<Interval>)
Uuid(Option<Uuid>)
Array(Option<Box<[Value]>>, Box<Value>, u32)
Homogeneous array (values, inner type, length).
List(Option<Vec<Value>>, Box<Value>)
Variable-length list (values, inner type).
Map(Option<HashMap<Value, Value>>, Box<Value>, Box<Value>)
Map (entries, key type, value type).
Json(Option<Value>)
Struct(Option<Vec<(String, Value)>>, Vec<(String, Value)>, TableRef)
Named struct (fields, field types, type name).
Unknown(Option<String>)
Unknown type (usually used when no further information is available).
Implementations§
Trait Implementations§
Source§impl Expression for Value
impl Expression for Value
Source§fn write_query(
&self,
writer: &dyn SqlWriter,
context: &mut Context,
out: &mut DynQuery,
)
fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, )
Render the expression into SQL.
Source§fn accept_visitor(
&self,
matcher: &mut dyn ExpressionVisitor,
writer: &dyn SqlWriter,
context: &mut Context,
out: &mut DynQuery,
) -> bool
fn accept_visitor( &self, matcher: &mut dyn ExpressionVisitor, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, ) -> bool
Match the expression.
Source§fn as_identifier(&self, context: &mut Context) -> String
fn as_identifier(&self, context: &mut Context) -> String
Convert expression to an identifier string.
Source§impl From<Value> for DefaultValueType
impl From<Value> for DefaultValueType
Source§impl OpPrecedence for Value
impl OpPrecedence for Value
Source§fn precedence(&self, _writer: &dyn SqlWriter) -> i32
fn precedence(&self, _writer: &dyn SqlWriter) -> i32
Lower numbers bind weaker, writers parenthesize when child precedence <= operator precedence.
Source§impl ToTokens for Value
impl ToTokens for Value
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Eq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.