pub enum SqlStorageValue {
Null,
Boolean(bool),
Integer(i64),
Float(f64),
String(String),
Blob(Vec<u8>),
}
Expand description
A value that can be stored in Durable Object SQL storage.
This enum represents the types that can be safely passed to SQL queries while maintaining type safety and proper conversion to JavaScript values.
Variants§
Null
SQL NULL value
Boolean(bool)
Boolean value
Integer(i64)
64-bit signed integer
Precision may be lost if outside JavaScript safe integer range. Use try_from_i64
to ensure safety.
Float(f64)
64-bit floating point number
String(String)
UTF-8 string
Blob(Vec<u8>)
Binary data
Implementations§
Source§impl SqlStorageValue
impl SqlStorageValue
Sourcepub fn try_from_i64(value: i64) -> Result<Self>
pub fn try_from_i64(value: i64) -> Result<Self>
Create a new Integer value, checking if it’s within JavaScript safe integer bounds.
Returns an error if the value is outside the range that can be safely represented in JavaScript (±2^53 - 1).
Trait Implementations§
Source§impl Clone for SqlStorageValue
impl Clone for SqlStorageValue
Source§fn clone(&self) -> SqlStorageValue
fn clone(&self) -> SqlStorageValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SqlStorageValue
impl Debug for SqlStorageValue
Source§impl From<&str> for SqlStorageValue
impl From<&str> for SqlStorageValue
Source§impl<T> From<Option<T>> for SqlStorageValuewhere
T: Into<SqlStorageValue>,
impl<T> From<Option<T>> for SqlStorageValuewhere
T: Into<SqlStorageValue>,
Source§impl From<SqlStorageValue> for JsValue
impl From<SqlStorageValue> for JsValue
Source§fn from(val: SqlStorageValue) -> Self
fn from(val: SqlStorageValue) -> Self
Converts to this type from the input type.
Source§impl From<String> for SqlStorageValue
impl From<String> for SqlStorageValue
Source§impl From<bool> for SqlStorageValue
impl From<bool> for SqlStorageValue
Source§impl From<f64> for SqlStorageValue
impl From<f64> for SqlStorageValue
Source§impl From<i32> for SqlStorageValue
impl From<i32> for SqlStorageValue
Source§impl From<i64> for SqlStorageValue
impl From<i64> for SqlStorageValue
Source§impl PartialEq for SqlStorageValue
impl PartialEq for SqlStorageValue
Source§impl TryFrom<JsValue> for SqlStorageValue
impl TryFrom<JsValue> for SqlStorageValue
impl StructuralPartialEq for SqlStorageValue
Auto Trait Implementations§
impl Freeze for SqlStorageValue
impl RefUnwindSafe for SqlStorageValue
impl Send for SqlStorageValue
impl Sync for SqlStorageValue
impl Unpin for SqlStorageValue
impl UnwindSafe for SqlStorageValue
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