pub enum DbValue {
Null,
Integer(i64),
Text(String),
Blob(Vec<u8>),
Uuid([u8; 16]),
}Expand description
A Db value — used for both parameters and query results.
Variants§
Null
SQL NULL.
Integer(i64)
Signed 64-bit integer.
Text(String)
UTF-8 text.
Blob(Vec<u8>)
Raw byte string.
Uuid([u8; 16])
16-byte UUID.
Implementations§
Source§impl DbValue
impl DbValue
Sourcepub fn from_u64(value: u64) -> Result<Self, DbError>
pub fn from_u64(value: u64) -> Result<Self, DbError>
Build an Integer from a u64, erroring when it
exceeds i64::MAX. SQL backends store signed 64-bit integers and the
HLC persist guard merges them with a signed MAX/GREATEST, so a value
past i64::MAX could neither round-trip nor order correctly — reject it
rather than silently wrap to a negative. Use this everywhere a u64
(packed HLC timestamp, counter, …) is bound into SQL instead of a raw
as i64 cast. The real clock stays far below the bound (millis below
2^47, ~year 6400).
Trait Implementations§
impl StructuralPartialEq for DbValue
Auto Trait Implementations§
impl Freeze for DbValue
impl RefUnwindSafe for DbValue
impl Send for DbValue
impl Sync for DbValue
impl Unpin for DbValue
impl UnsafeUnpin for DbValue
impl UnwindSafe for DbValue
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