pub enum Value {
Show 29 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<String>),
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>),
Struct(Option<Vec<(String, Value)>>, Vec<(String, Value)>),
Unknown(Option<String>),
}Expand description
Strongly-typed, nullable SQL value representation used across Tank.
Variants wrap Option<T> – None signifies SQL NULL (except Null which
unconditionally represents a NULL of unknown type). Complex variants carry
additional shape metadata (element type, length, precision, etc.).
Variants§
Null
Untyped NULL placeholder.
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)
Arbitrary precision decimal with width/scale hints.
Char(Option<char>)
Varchar(Option<String>)
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)
Fixed-size homogeneous array.
List(Option<Vec<Value>>, Box<Value>)
Variable length homogeneous list.
Map(Option<HashMap<Value, Value>>, Box<Value>, Box<Value>)
Map with homogeneous key/value types.
Struct(Option<Vec<(String, Value)>>, Vec<(String, Value)>)
Struct with named fields and their types.
Unknown(Option<String>)
Parsing fallback / unknown driver-provided type.
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 String,
)
fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut String, )
Serialize the expression into the output string using the dialect writer.
Source§fn is_ordered(&self) -> bool
fn is_ordered(&self) -> bool
Whether this expression carries ordering (ASC/DESC) information.
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 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.